mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-11-17 01:44:23 +08:00
66de566a00
* 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
36 lines
734 B
TypeScript
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}
|
|
/>
|
|
);
|
|
}
|