import { SingleEvent } from '@api/events';
import { Text } from 'react-native';

export const renderSpotsText = (e: SingleEvent) => {
  switch (e.registrations_info) {
    case 2:
      return (
        <Text>
          <Text style={{ fontWeight: '700' }}>{(e.capacity ?? 0) - (e.available ?? 0)}</Text> total
          spots available
        </Text>
      );
    case 3:
      return (
        <Text>
          <Text style={{ fontWeight: '700' }}>{e.available}</Text> spots remaining
        </Text>
      );
    case 4:
      return (
        <Text>
          <Text style={{ fontWeight: '700' }}>{e.participants}</Text> Nomads joined
        </Text>
      );
    case 5:
      return (
        <Text>
          <Text style={{ fontWeight: '700' }}>
            {e.available ?? (e.capacity ?? 0) - (e.participants ?? 0)} / {e.capacity}
          </Text>{' '}
          spots available
        </Text>
      );
    default:
      return '';
  }
};
