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

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

/** Groups related Listbox items together. */
export function ListboxGroup(props: ListboxGroupProps): JSX.Element {
  const [local, rest] = splitProps(props, ["children"]);
  return (
    <div role="group" {...rest}>
      {local.children}
    </div>
  );
}
