miinventario-mobile-v2/src/components/skeletons/StoreCardSkeleton.tsx
rckrdmrd eb718a95aa Sincronización desde miinventario/apps/mobile - Estándar multi-repo v2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:29:24 -06:00

81 lines
2.0 KiB
TypeScript

import React from 'react';
import { View, StyleSheet } from 'react-native';
import { Skeleton, SkeletonText, SkeletonCircle } from '../ui/Skeleton';
import { useTheme } from '../../theme/ThemeContext';
/**
* Skeleton para tarjeta de tienda
*/
export function StoreCardSkeleton() {
const { colors } = useTheme();
return (
<View style={[styles.container, { backgroundColor: colors.card }]}>
<View style={styles.header}>
<SkeletonCircle size={56} />
<View style={styles.headerContent}>
<SkeletonText width="60%" height={18} />
<SkeletonText width="80%" height={12} style={{ marginTop: 6 }} />
</View>
</View>
<View style={styles.stats}>
<View style={styles.stat}>
<SkeletonText width={40} height={20} />
<SkeletonText width={60} height={10} style={{ marginTop: 4 }} />
</View>
<View style={styles.stat}>
<SkeletonText width={40} height={20} />
<SkeletonText width={60} height={10} style={{ marginTop: 4 }} />
</View>
<View style={styles.stat}>
<SkeletonText width={40} height={20} />
<SkeletonText width={60} height={10} style={{ marginTop: 4 }} />
</View>
</View>
</View>
);
}
/**
* Lista de skeletons de tiendas
*/
export function StoreListSkeleton({ count = 3 }: { count?: number }) {
return (
<View style={styles.list}>
{Array.from({ length: count }).map((_, index) => (
<StoreCardSkeleton key={index} />
))}
</View>
);
}
const styles = StyleSheet.create({
container: {
borderRadius: 16,
padding: 16,
marginBottom: 12,
},
header: {
flexDirection: 'row',
alignItems: 'center',
},
headerContent: {
flex: 1,
marginLeft: 12,
},
stats: {
flexDirection: 'row',
justifyContent: 'space-around',
marginTop: 16,
paddingTop: 16,
borderTopWidth: 1,
borderTopColor: 'rgba(0,0,0,0.1)',
},
stat: {
alignItems: 'center',
},
list: {
padding: 16,
},
});