import { AriaTagGroupProps } from "@react-aria/tag"; import { AriaProps, FieldInputProps } from "../../../types"; import { ErrorMessage, Label, Message } from "@components/Fields"; import { ChipGroupField } from "@components/Fields/ChipGroupField"; export interface ChipGroupProps extends AriaProps>, Omit { /** Whether the label is placed above the * group, or inline with the chips */ labelPlacement?: "above" | "inline"; } /** * A generic ChipGroup component that renders a group of chips with optional labels, messages, and error messages. */ export function ChipGroup(props: ChipGroupProps) { const { label, message, error, labelPlacement = "above", items, children, ...rest } = props; return ( {labelPlacement === "above" && label && ( )} {label} } > {children} {message && {message}} {error && {error}} ); }