Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

773 B
Raw Blame
import { type ReactNode, useId } from "react";
import { SettingsRow } from "@/components/settings/settings-row";
import { Label } from "@/components/ui/label";
import { Switch } from "@/components/ui/switch";

type PreferenceSwitchRowProps = {
  title: ReactNode;
  description?: ReactNode;
  checked: boolean;
  onCheckedChange: (checked: boolean) => void;
};

export function PreferenceSwitchRow({
  title,
  description,
  checked,
  onCheckedChange,
}: PreferenceSwitchRowProps) {
  const id = useId();

  return (
    <SettingsRow
      className="flex-row items-center gap-6"
      title={<Label htmlFor={id}>{title}</Label>}
      description={description}
    >
      <Switch id={id} checked={checked} onCheckedChange={onCheckedChange} />
    </SettingsRow>
  );
}