import React from 'react';
import { Link } from 'react-router-dom';

interface Team {
  id: string;
  name: string;
}

interface TournamentCardProps {
  id: string;
  name: string;
  location: string;
  teams: Team[];
  maxParticipants: number;
}

const TournamentCard: React.FC<TournamentCardProps> = ({ id, name, location, teams, maxParticipants }) => {
  return (
    <Link to={`/tournaments/${id}`} className="block border rounded-lg p-4 shadow hover:shadow-lg transition cursor-pointer bg-white">
      <h3 className="text-xl font-semibold mb-2">{name}</h3>
      <p className="text-gray-700 mb-1">
        Teilnehmer: {teams.length} / {maxParticipants}
      </p>
      <p className="text-gray-600">Ort: {location}</p>
    </Link>
  );
};

export default TournamentCard;
