import { Button, cn } from "@cloudflare/kumo"; import { XIcon } from "@phosphor-icons/react"; import type { ReactNode } from "react"; export type TermChipProps = { children: ReactNode; /** Shown before the label (a star for the primary term). */ icon?: ReactNode; /** Quieter chip for a proposed or otherwise pending term. */ tone?: "default" | "pending"; className?: string; } & ( | { /** Accessible name of the remove button ("Remove AI"), from the screen's catalog. */ removeLabel: string; onRemove: () => void; } | { removeLabel?: undefined; onRemove?: undefined } ); /** * A removable chip with Kumo `Combobox.Chip`'s anatomy (h-6, hairline ring, overlay fill), for * selections made outside a `Combobox` — the tags chosen with the tag `Autocomplete`. */ export function TermChip({ children, icon, removeLabel, onRemove, tone = "default", className, }: TermChipProps) { return ( {icon && {icon}} {children} {onRemove && (