// Chip — WealthX DS (built on Badge)
//
// Badge extended with an optional dismiss button.
// Passes all Badge props (variant, className, etc.) through unchanged.
//
// Usage:
// Label
// handleRemove(id)}>Label
// Label
import { type ReactElement } from "react";
import * as React from "react";
import { X } from "lucide-react";
import { Button } from "./button";
import type { VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
import { badgeVariants } from "@/components/ui/badge";
export interface ChipProps
extends React.ComponentProps<"span">, VariantProps {
/** When provided, renders a dismiss (×) button inside the chip. */
onRemove?: () => void;
disabled?: boolean;
}
function Chip({
className,
variant = "secondary",
onRemove,
disabled,
children,
...props
}: ChipProps): ReactElement {
return (
{children}
{onRemove ? (
) : null}
);
}
export { Chip };