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

SettingsProjectOverridesSection.tsx

34 lines1.1 KB

1import { useGT } from "gt-react-native";
2import { View } from "react-native";
3​
4import { Button } from "../../../components/ui/Button";
5import { AppText as Text } from "../../../components/ui/AppText";
6import { SettingsSection } from "./SettingsSection";
7​
8export function SettingsProjectOverridesSection(props: {
9 readonly projectLabel: string;
10 readonly hasOverrides: boolean;
11 readonly pending: boolean;
12 readonly disabled?: boolean;
13 readonly onClear: () => void;
14}) {
15 const gt = useGT();
16 return (
17 <SettingsSection title={gt("Project")}>
18 <View className="min-h-16 flex-row items-center gap-3 px-4 py-3">
19 <Text className="min-w-0 flex-1 text-base text-foreground" numberOfLines={2}>
20 {props.projectLabel}
21 </Text>
22 {!props.pending && props.hasOverrides ? (
23 <Button
24 label={gt("Use defaults")}
25 accessibilityHint={gt("Use environment defaults for this project")}
26 tone="text"
27 disabled={props.disabled}
28 onPress={props.onClear}
29 />
30 ) : null}
31 </View>
32 </SettingsSection>
33 );