import { useMemo } from 'react'; import { CustomIconProps } from '../CustomIcon'; import { ReactNativeIcon } from './ReactNativeIcon'; import { cloneIcon } from 'utils/cloneIcon'; import { PWAIcon } from './PWAIcon'; import { WebAppIcon } from './WebAppIcon'; import { KotlinIcon } from './KotlinIcon'; import { SwitfIcon } from './SwiftIcon'; const TEMPLATE_ICONS = [ 'react-native', 'pwa', 'web', 'kotlin', 'swift', ] as const; export type TemplateIconType = (typeof TEMPLATE_ICONS)[number]; export interface TemplateIconProps extends CustomIconProps { type: TemplateIconType; } export const TemplateIcon = ({ type, ...props }: TemplateIconProps) => { const renderIcon = useMemo(() => { switch (type) { case 'react-native': return ; case 'pwa': return ; case 'web': return ; case 'kotlin': return ; case 'swift': return ; default: throw new Error(`Invalid template icon type: ${type}`); } }, [type]); return cloneIcon(renderIcon, props) as JSX.Element; };