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

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

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

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