import { Link } from "react-router-dom"; import { useComputedColorScheme } from "@mantine/core"; import { IconX } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { ILabel } from "@/features/label/types/label.types.ts"; import { getLabelColor } from "@/features/label/utils/label-colors.ts"; import classes from "@/features/label/label.module.css"; type LabelChipProps = { label: Pick; onRemove?: () => void; asLink?: boolean; }; export function LabelChip({ label, onRemove, asLink }: LabelChipProps) { const { t } = useTranslation(); const scheme = useComputedColorScheme("light"); const c = getLabelColor(label.name, scheme); const nameNode = asLink ? ( e.stopPropagation()} > {label.name} ) : ( {label.name} ); return ( {nameNode} {onRemove && ( )} ); }