Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

SettingsSwitchRow.tsx

27 lines735 Bytes

1import type { ComponentProps } from "react";
2​
3import { ThemedSwitch } from "../../../components/ThemedSwitch";
4import { SettingsControlRow } from "./SettingsControlRow";
5​
6export function SettingsSwitchRow(
7 props: Omit<ComponentProps<typeof SettingsControlRow>, "children"> & {
8 readonly value: boolean;
9 readonly onValueChange: (value: boolean) => void;
10 },
11) {
12 return (
13 <SettingsControlRow
14 disabled={props.disabled}
15 icon={props.icon}
16 label={props.label}
17 subtitle={props.subtitle}
18 >
19 <ThemedSwitch
20 accessibilityLabel={props.label}
21 disabled={props.disabled}
22 onValueChange={props.onValueChange}
23 value={props.value}
24 />
25 </SettingsControlRow>
26 );