// components/ui/LabeledSwitch.tsx 'use client' import { useId, type ReactNode } from 'react' import clsx from 'clsx' import Switch, { type SwitchProps } from './Switch' type Props = Omit & { label: ReactNode description?: ReactNode labelPosition?: 'left' | 'right' className?: string } export default function LabeledSwitch({ label, description, labelPosition = 'left', id, className, compact = false, ...switchProps }: Props) { const reactId = useId() const switchId = id ?? `sw-${reactId}` const labelId = `${switchId}-label` const descId = `${switchId}-desc` if (labelPosition === 'right') { return (
{' '} {description ? ( {description} ) : null}
) } return (
{description ? ( {description} ) : null}
) }