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

EmptyState.tsx

27 lines901 Bytes

1import { Pressable, View } from "react-native";
2​
3import { AppText as Text } from "./AppText";
4​
5export function EmptyState(props: {
6 readonly title: string;
7 readonly detail: string;
8 readonly actionLabel?: string;
9 readonly onAction?: () => void;
10}) {
11 return (
12 <View className="rounded-[22px] border border-border bg-card p-5">
13 <Text className="font-t3-bold text-lg text-foreground">{props.title}</Text>
14 <Text className="mt-2 font-sans text-sm leading-[21px] text-foreground-muted">
15 {props.detail}
16 </Text>
17 {props.actionLabel && props.onAction ? (
18 <Pressable
19 className="mt-4 self-start rounded-full bg-primary px-4 py-2.5 active:opacity-70"
20 onPress={props.onAction}
21 >
22 <Text className="text-sm font-t3-bold text-primary-foreground">{props.actionLabel}</Text>
23 </Pressable>
24 ) : null}
25 </View>
26 );