import { asset } from "$fresh/runtime.ts";

export const Emoji = (props: { class?: string; name: string }) => {
  return props.name
    ? props.name.endsWith(".png")
      ? (
        <img
          class={`${props?.class || ""}`}
          src={asset(`/emojis/${props.name}`)}
        />
      )
      : <span>{props.name}</span>
    : <></>;
};
