import type { FC, MouseEventHandler, ReactNode } from 'react' import { XCircleIcon } from '@heroicons/react/24/outline' import classNames from 'classnames' const SIZE = { default: 'h-[24px]', sm: 'h-5 !text-[10px]', lg: 'h-12 text-[14px]', } const FILLED = { default: 'bg-gray-700 text-white', white: 'bg-high-emphesis text-slate-700', purple: 'bg-purple-500 bg-opacity-20 text-purple', yellow: 'bg-yellow-500 bg-opacity-20 text-yellow', blue: 'bg-blue-500 bg-opacity-20 text-blue', green: 'bg-green-500 bg-opacity-20 text-green-600 dark:text-green', pink: 'bg-pink-500 bg-opacity-20 text-pink', red: 'bg-red-500 bg-opacity-20 text-red', gray: 'bg-black/10 dark:bg-white/10 text-slate-700 dark:text-slate-300', } const VARIANT = { filled: FILLED, } export type ChipColor = 'default' | 'purple' | 'yellow' | 'blue' | 'green' | 'white' | 'pink' | 'red' | 'gray' export type ChipSize = 'default' | 'sm' export type ChipVariant = 'filled' export interface ChipProps { label: ReactNode color?: ChipColor variant?: ChipVariant size?: ChipSize opaque?: boolean className?: string onClick?: MouseEventHandler icon?: ReactNode endIcon?: ReactNode id?: string } export const Chip: FC = ({ label, color = 'default', variant = 'filled', size = 'default', className = '', onClick, icon = undefined, opaque, endIcon = , id = '', }) => { return (
{icon && ( )} {label} {onClick && ( )}
) }