mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-23 14:59:24 +01:00
* chore: shadcn config * feat: add shadcn ui config * style: adjust styles * style: adjust styles * refactor: update style * style: adjust styles * style: adjust styles * style: adjust styles * style: adjust styles * refactor: update * refactor: update * refactor: update * refactor: update * style: adjust styles * style: adjust styles * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * style: web styles * refactor: update * style: web styles * style: web styles * refactor: update * refactor: update * refactor: update * chhore: add * chore: add * refactor: update * refactor: update * refactor: update * refactor: update * chore: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * chore: rename * refactor: update * refactor: update * chore: add * refactor: update * chore: update * chroe: up * refactor: update * refactor: update * chore: up * refactor: update * chore: up * feat: support for extracting css variables * chore: update * fix: fixed dark mode * refactor: update * refactor: update * refactor: update * refactor: update * docs: update release notes * style: adjust styles * style: adjust styles * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update * refactor: update --------- Co-authored-by: ayang <473033518@qq.com>
27 lines
633 B
TypeScript
27 lines
633 B
TypeScript
import { Switch } from "@/components/ui/switch";
|
|
import clsx from "clsx";
|
|
|
|
type BaseSwitchProps = React.ComponentProps<typeof Switch>;
|
|
interface SettingsToggleProps
|
|
extends Omit<BaseSwitchProps, "onChange" | "onCheckedChange"> {
|
|
label: string;
|
|
className?: string;
|
|
onChange?: (checked: boolean) => void;
|
|
}
|
|
|
|
export default function SettingsToggle(props: SettingsToggleProps) {
|
|
const { label, className, onChange, ...rest } = props;
|
|
|
|
return (
|
|
<Switch
|
|
{...rest}
|
|
aria-label={label}
|
|
onCheckedChange={(v) => onChange?.(v)}
|
|
className={clsx(
|
|
"h-5 w-9",
|
|
className
|
|
)}
|
|
/>
|
|
);
|
|
}
|