All files / apps/roomBooking/src/screens/ChooseTime WheelPickerItem.tsx

100% Statements 5/5
66.66% Branches 4/6
100% Functions 2/2
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                                2x 813x 813x                 813x                                  
import { memo } from 'react';
import { Text } from 'react-native';
 
import { makeStyles } from '@repo/ui/themes/makeStyles';
import { textStyles } from '@repo/ui/themes/typography';
 
export interface WheelPickerItemType {
  value: string;
  label: string;
}
 
interface WheelPickerItemProps {
  item: WheelPickerItemType;
  isBooked?: boolean;
}
 
const WheelPickerItem = ({ item, isBooked }: WheelPickerItemProps) => {
  const styles = useStyles();
  return (
    <Text style={[styles.itemText, isBooked && styles.bookedItemText]}>
      {item.label}
    </Text>
  );
};
 
export default memo(WheelPickerItem);
 
const useStyles = makeStyles(theme => ({
  itemText: {
    ...textStyles.content.medium,
    fontSize: 24,
    fontWeight: '500',
    color: theme.isNewTheme ? theme.colors.text.onBehalf : theme.colors.slate97,
    textAlign: 'center',
    lineHeight: 60,
  },
  bookedItemText: {
    ...textStyles.content.semiBold,
    color: theme.isNewTheme
      ? theme.colors.text.emphasis
      : theme.colors.text.error,
    fontWeight: '600',
  },
}));