First commit of the new app
This commit is contained in:
20
assets/components/reserva/Stars.tsx
Normal file
20
assets/components/reserva/Stars.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user