From 017933ddd2f6044bd335bc737db96c0f34d8080c Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:49 +0530 Subject: [PATCH] feat: add labelled switch row --- app/components/ui/switch-row.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/components/ui/switch-row.tsx diff --git a/app/components/ui/switch-row.tsx b/app/components/ui/switch-row.tsx new file mode 100644 index 0000000..ad761e0 --- /dev/null +++ b/app/components/ui/switch-row.tsx @@ -0,0 +1,27 @@ +import { Label } from '~/components/ui/label'; +import { Switch } from '~/components/ui/switch'; +import { Text } from '~/components/ui/text'; +import { cn } from '~/lib/utils'; + +interface SwitchRowProps { + id: string; + label: string; + hint?: string; + checked: boolean; + disabled?: boolean; + framed?: boolean; + onCheckedChange: (checked: boolean) => void; +} + +// A labelled on/off setting +export function SwitchRow({ id, label, hint, checked, disabled, framed, onCheckedChange }: SwitchRowProps) { + return ( +
+
+ + {hint && {hint}} +
+ +
+ ); +}