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

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

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