mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-06 21:34:28 -05:00
23 lines
437 B
TypeScript
23 lines
437 B
TypeScript
import { Switch } from "@headlessui/react";
|
|
import clsx from "clsx";
|
|
|
|
export function Toggle({
|
|
checked,
|
|
setChecked,
|
|
tiny,
|
|
}: {
|
|
checked: boolean;
|
|
setChecked: (checked: boolean) => void;
|
|
tiny?: boolean;
|
|
}) {
|
|
return (
|
|
<Switch
|
|
checked={checked}
|
|
onChange={setChecked}
|
|
className={clsx("toggle", { checked, tiny })}
|
|
>
|
|
<span className={clsx("toggle-dot", { checked, tiny })} />
|
|
</Switch>
|
|
);
|
|
}
|