eletrotupi / tcc/ frontend/components/ui/EmptyState.tsxc901c35af9c84b6a29e5185545ced1129f33b8f4
1019 B | 42 lines Raw
1
import { View, StyleSheet } from "react-native";
2
import { Text } from "@/components/ui/Text";
3
import { Ionicons } from "@expo/vector-icons";
4
import { Colors, Typography, Spacing } from "@/constants/theme";
5

6
interface EmptyStateProps {
7
  title: string;
8
  subtitle?: string;
9
  icon?: keyof typeof Ionicons.glyphMap;
10
}
11

12
export function EmptyState({
13
  title,
14
  subtitle,
15
  icon = "leaf-outline",
16
}: EmptyStateProps) {
17
  return (
18
    <View style={styles.container}>
19
      <Ionicons name={icon} size={40} color={Colors.light.textSecondary} />
20
      <Text style={styles.title}>{title}</Text>
21
      {subtitle && <Text style={styles.subtitle}>{subtitle}</Text>}
22
    </View>
23
  );
24
}
25

26
const styles = StyleSheet.create({
27
  container: {
28
    alignItems: "center",
29
    paddingVertical: 32,
30
    gap: Spacing.inlineGapSm,
31
  },
32
  title: {
33
    ...Typography.bodyLg,
34
    color: Colors.light.text,
35
    textAlign: "center",
36
  },
37
  subtitle: {
38
    ...Typography.bodyMd,
39
    color: Colors.light.textSecondary,
40
    textAlign: "center",
41
  },
42
});