import { StyleSheet, View } from 'react-native'; import { Text } from '@/aesthetics/Text'; import { font, radius, spacing, useColors } from '@/aesthetics/styles'; type IngredientChipsProps = { ingredients: string[]; limit?: number; }; export function IngredientChips({ ingredients, limit }: IngredientChipsProps) { const c = useColors(); const displayIngredients = limit ? ingredients.slice(0, limit) : ingredients; const hasMore = limit && ingredients.length > limit; return ( {displayIngredients.map((ing, i) => ( {ing} ))} {hasMore && ( +{ingredients.length - limit} )} ); } const styles = StyleSheet.create({ list: { flexDirection: 'row', flexWrap: 'wrap', gap: spacing.xs, }, chip: { paddingHorizontal: spacing.sm, paddingVertical: spacing.xs, borderRadius: radius.pill, }, chipText: { fontSize: font.xs, }, });