import type { JSX, ValidComponent } from "solid-js" import { splitProps } from "solid-js" import type { PolymorphicProps } from "@kobalte/core" import * as SwitchPrimitive from "@kobalte/core/switch" import { cn } from "~/styles/utils" const Switch = SwitchPrimitive.Root const SwitchDescription = SwitchPrimitive.Description const SwitchErrorMessage = SwitchPrimitive.ErrorMessage type SwitchControlProps = SwitchPrimitive.SwitchControlProps & { class?: string | undefined children?: JSX.Element } const SwitchControl = ( props: PolymorphicProps ) => { const [local, others] = splitProps(props as SwitchControlProps, ["class", "children"]) return ( <> {local.children} ) } type SwitchThumbProps = SwitchPrimitive.SwitchThumbProps & { class?: string | undefined } const SwitchThumb = ( props: PolymorphicProps ) => { const [local, others] = splitProps(props as SwitchThumbProps, ["class"]) return ( ) } type SwitchLabelProps = SwitchPrimitive.SwitchLabelProps & { class?: string | undefined } const SwitchLabel = ( props: PolymorphicProps ) => { const [local, others] = splitProps(props as SwitchLabelProps, ["class"]) return ( ) } export { Switch, SwitchControl, SwitchThumb, SwitchLabel, SwitchDescription, SwitchErrorMessage }