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

const Registrations = ({
  registrations,
  className,
}: {
  registrations?: User[]
  className: string
}) => {
  return (
    <div className={className}>
      <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>
      )}
    </div>
  )
}

export default Registrations
