Files
flvx/vite-frontend/src/shadcn-bridge/heroui/switch.tsx
T
sagit 66de566a00 fix(frontend): stabilize multiselect behavior and UI spacing (#154)
* fix(frontend): left-align announcement logo in homepage banner

* fix(frontend): keep multiselect panels floating and preserve summaries

* fix(frontend): rebalance config card header spacing

* fix(frontend): normalize formatting and fix multiselect modal behavior

* fix(frontend): restore config divider spacing on desktop
2026-02-19 20:50:12 +08:00

36 lines
734 B
TypeScript

import * as React from "react";
import { Switch as BaseSwitch } from "@/components/ui/switch";
import { cn } from "@/lib/utils";
export interface SwitchProps
extends Omit<
React.ComponentProps<typeof BaseSwitch>,
"checked" | "onCheckedChange"
> {
classNames?: Record<string, string>;
color?: string;
isDisabled?: boolean;
isSelected?: boolean;
onValueChange?: (value: boolean) => void;
size?: string;
}
export function Switch({
className,
isDisabled,
isSelected,
onValueChange,
...props
}: SwitchProps) {
return (
<BaseSwitch
checked={Boolean(isSelected)}
className={cn(className)}
disabled={isDisabled}
onCheckedChange={onValueChange}
{...props}
/>
);
}