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

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

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