import { type ComponentProps, type FC, type ReactNode, forwardRef } from 'react' import Image from 'next/image' import classNames from '@/utils/classnames' const TriangleArrow: FC> = props => ( ) type OptionCardHeaderProps = { icon: ReactNode title: ReactNode description: string isActive?: boolean activeClassName?: string effectImg?: string disabled?: boolean } export const OptionCardHeader: FC = (props) => { const { icon, title, description, isActive, activeClassName, effectImg, disabled } = props return
{isActive && effectImg && }
{icon}
{title}
{description}
} type OptionCardProps = { icon: ReactNode className?: string activeHeaderClassName?: string title: ReactNode description: string isActive?: boolean actions?: ReactNode effectImg?: string onSwitched?: () => void noHighlight?: boolean disabled?: boolean } & Omit, 'title' | 'onClick'> export const OptionCard: FC = forwardRef((props, ref) => { const { icon, className, title, description, isActive, children, actions, activeHeaderClassName, style, effectImg, onSwitched, noHighlight, disabled, ...rest } = props return
{ if (!isActive && !disabled) onSwitched?.() }} {...rest} ref={ref} > {/** Body */} {isActive && (children || actions) &&
{children} {actions &&
{actions}
}
}
}) OptionCard.displayName = 'OptionCard'