import { User } from '../../gql'

const Registrations = ({ registrations }: { registrations?: User[] }) => {
  return (
    <>
      <h2>Registrations</h2>
      {registrations && registrations.length > 0 ? (
        <ul>
          {registrations.map(registration => (
            <li key={registration.id}>
              <button type='button' onClick={() => alert('not implemented.')}>
                delete
              </button>
              Registration: {registration.name}
            </li>
          ))}
        </ul>
      ) : (
        <p>No registrations found.</p>
      )}
    </>
  )
}

export default Registrations
