This repository has been archived on 2026-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
Gishen-Mob/components/ui/EmptyState.tsx
kirukib 7310a349c5 Add Gishen mobile app with complete demo shopping and care flows.
Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 01:21:32 +03:00

62 lines
1.4 KiB
TypeScript

import { Ionicons } from "@expo/vector-icons";
import { View } from "react-native";
import { Button } from "@/components/ui/Button";
import { Text } from "@/components/ui/Text";
import { colors } from "@/lib/theme";
export function EmptyState({
icon = "cube-outline",
title,
body,
actionTitle,
onAction,
compact,
}: {
icon?: keyof typeof Ionicons.glyphMap;
title: string;
body?: string;
actionTitle?: string;
onAction?: () => void;
compact?: boolean;
}) {
return (
<View
style={{
alignItems: "center",
paddingVertical: compact ? 32 : 56,
paddingHorizontal: 24,
}}
>
<View
style={{
width: 72,
height: 72,
borderRadius: 36,
backgroundColor: colors.brandSoft,
alignItems: "center",
justifyContent: "center",
}}
>
<Ionicons name={icon} size={32} color={colors.brandText} />
</View>
<Text variant="h2" center style={{ marginTop: 18 }}>
{title}
</Text>
{body ? (
<Text variant="bodySm" color={colors.subtle} center style={{ marginTop: 6, maxWidth: 280 }}>
{body}
</Text>
) : null}
{actionTitle && onAction ? (
<Button
title={actionTitle}
onPress={onAction}
size="md"
fullWidth={false}
style={{ marginTop: 20 }}
/>
) : null}
</View>
);
}