import type { JSX } from "solid-js";
import { createUniqueId, splitProps } from "solid-js";

export interface ComboboxGroupLabelProps extends JSX.HTMLAttributes<HTMLDivElement> {
  children?: JSX.Element | undefined;
}

/** Label for a Combobox group. */
export function ComboboxGroupLabel(props: ComboboxGroupLabelProps): JSX.Element {
  const [local, rest] = splitProps(props, ["children"]);
  const id = createUniqueId();
  return (
    <div id={id} role="presentation" {...rest}>
      {local.children}
    </div>
  );
}
