import { JSX } from 'preact/jsx-runtime' import { Icons } from './icons.tsx' interface IconButtonProps { active?: boolean text?: string icon?: keyof (typeof Icons) } export function IconButton( { icon, children, active, ...props }: & IconButtonProps & JSX.HTMLAttributes, ) { const Icon = typeof icon === 'string' ? Icons[icon as keyof typeof Icons] : (() => <>) return ( ) }