'use client' import type { FC } from 'react' import { init } from 'emoji-mart' import data from '@emoji-mart/data' import style from './style.module.css' import classNames from '@/utils/classnames' import type { AppIconType } from '@/types/app' init({ data }) export type AppIconProps = { size?: 'xs' | 'tiny' | 'small' | 'medium' | 'large' rounded?: boolean iconType?: AppIconType | null icon?: string background?: string | null imageUrl?: string | null className?: string innerIcon?: React.ReactNode onClick?: () => void } const AppIcon: FC = ({ size = 'medium', rounded = false, iconType, icon, background, imageUrl, className, innerIcon, onClick, }) => { const wrapperClassName = classNames( style.appIcon, size !== 'medium' && style[size], rounded && style.rounded, className ?? '', 'overflow-hidden', ) const isValidImageIcon = iconType === 'image' && imageUrl return {isValidImageIcon ? app icon : (innerIcon || ((icon && icon !== '') ? : )) } } export default AppIcon