sendou.ink/app/components/elements/Switch.tsx
Kalle 8f156fb917
Team editors in addition to the owner (#2077)
* Initial

* Handle owner leaving

* Remove old team queries

* Progress

* Retire old toggle

* e2e tests

* Divide loaders/actions of team pages
2025-02-04 10:56:33 +02:00

23 lines
526 B
TypeScript

import clsx from "clsx";
import {
Switch as ReactAriaSwitch,
type SwitchProps as ReactAriaSwitchProps,
} from "react-aria-components";
interface SendouSwitchProps extends ReactAriaSwitchProps {
children?: React.ReactNode;
size?: "small" | "medium";
}
export function SendouSwitch({ children, size, ...rest }: SendouSwitchProps) {
return (
<ReactAriaSwitch
{...rest}
className={clsx("react-aria-Switch", { small: size === "small" })}
>
<div className="indicator" />
{children}
</ReactAriaSwitch>
);
}