The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { ServerSettings } from "@t3tools/contracts"; |
| 2 | import type { ComponentProps } from "react"; |
| 3 | |
| 4 | import { Switch } from "../ui/switch"; |
| 5 | import { useScopedSettingsMixed } from "./useScopedSettings"; |
| 6 | |
| 7 | export function ScopedSwitch({ |
| 8 | settingKeys, |
| 9 | checked, |
| 10 | ...props |
| 11 | }: ComponentProps<typeof Switch> & { settingKeys: readonly (keyof ServerSettings)[] }) { |
| 12 | const mixed = useScopedSettingsMixed(settingKeys); |
| 13 | return <Switch {...props} mixed={mixed} checked={mixed ? false : checked} />; |
| 14 | } |