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

SettingsProjectOverridesSection.tsx

38 lines1.3 KB

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