Open History to see the last commit
1import type { ComponentProps, ReactNode } from "react";
2import { Platform, View } from "react-native";
3
4import { SymbolView } from "../../../components/AppSymbol";
5import { AppText as Text } from "../../../components/AppText";
6import { cn } from "../../../lib/cn";
7
8export function SettingsControlRow(props: {
9 readonly disabled?: boolean;
10 readonly icon: ComponentProps<typeof SymbolView>["name"];
11 readonly label: string;
12 readonly subtitle?: string;
13 readonly children: ReactNode;
14}) {
15 return (
16 <View
17 className={cn(
18 "flex-row items-center gap-4 p-4 android:min-h-14 android:py-3",
19 props.subtitle && "android:min-h-18",
20 props.disabled && "opacity-[0.45]",
21 )}
22 >
23 <SymbolView
24 name={props.icon}
25 size={Platform.OS === "android" ? 24 : 22}
26 tintColorClassName="accent-icon"
27 type="monochrome"
28 weight="regular"
29 />
30 <View className="min-w-0 flex-1 android:gap-1">
31 <Text className="text-lg text-foreground android:text-base">{props.label}</Text>
32 {props.subtitle ? (
33 <Text className="text-sm text-foreground-muted">{props.subtitle}</Text>
34 ) : null}
35 </View>
36 {props.children}
37 </View>
38 );
39}