21 lines
608 B
TypeScript
21 lines
608 B
TypeScript
import { colors } from '@/assets/styles/colors';
|
|
import styles from '@/styles/screens/reserva/detail.styles';
|
|
import { FontAwesome } from '@expo/vector-icons';
|
|
import { View } from 'react-native';
|
|
|
|
type Props = {
|
|
stars: string | number;
|
|
};
|
|
|
|
export function Stars({ stars }: Props) {
|
|
const count = Math.max(0, Math.min(5, parseInt(String(stars || '0'), 10)));
|
|
if (!count) return null;
|
|
return (
|
|
<View style={styles.hotelStarsRow}>
|
|
{Array.from({ length: count }).map((_, i) => (
|
|
<FontAwesome key={`star-${i}`} name="star" size={16} color={colors.stars} />
|
|
))}
|
|
</View>
|
|
);
|
|
}
|