import { For, type Accessor, type Setter } from "solid-js"; // Exclude keys where the value type is boolean type NonBooleanKeys = { [K in keyof T]: T[K] extends boolean ? never : K; }[keyof T]; // Usage with Intl.DateTimeFormatOptions type NonBooleanDateTimeFormatOptionKeys = NonBooleanKeys; type Properties = { key: K; options: NonBooleanDateTimeFormatOptionKeys[K][]; value: Accessor; set: Setter; }; export default function OptionGroup< K extends keyof NonBooleanDateTimeFormatOptionKeys >(properties: Properties) { return (
{ const input = event.target; if (!(input instanceof HTMLInputElement)) throw new Error("Expected input to change"); // const value: NonBooleanDateTimeFormatOptionKeys = // input.value === "undefined" ? undefined : input.value; // properties.set(value); }} > {properties.key} {(option) => ( )}
); }