"use client"; import { FC } from "react"; import { Emoji } from "emoji-picker-react"; // Due to some weird issue with the import order, the import of useFontFaceObserver // should be after the imported here rather than some below helper functions as it is in the original file // eslint-disable-next-line import/order import useFontFaceObserver from "use-font-face-observer"; // plane imports import { TLogoProps } from "@plane/types"; import { LUCIDE_ICONS_LIST } from "@plane/ui"; import { emojiCodeToUnicode } from "@plane/utils"; type Props = { logo: TLogoProps; size?: number; type?: "lucide" | "material"; }; export const Logo: FC = (props) => { const { logo, size = 16, type = "material" } = props; // destructuring the logo object const { in_use, emoji, icon } = logo; // derived values const value = in_use === "emoji" ? emoji?.value : icon?.name; const color = icon?.color; const lucideIcon = LUCIDE_ICONS_LIST.find((item) => item.name === value); const isMaterialSymbolsFontLoaded = useFontFaceObserver([ { family: `Material Symbols Rounded`, style: `normal`, weight: `normal`, stretch: `condensed`, }, ]); // if no value, return empty fragment if (!value) return <>; if (!isMaterialSymbolsFontLoaded) { return ( ); } // emoji if (in_use === "emoji") { return ; } // icon if (in_use === "icon") { return ( <> {type === "lucide" ? ( <> {lucideIcon && ( )} ) : ( {value} )} ); } // if no value, return empty fragment return <>; };