import { createClient } from "@/lib/supabase/server";
import { PageHeader } from "@/components/dashboard/page-header";
import { PlayersRegistry } from "@/components/players/players-registry";

export default async function MasterPlayersPage() {
  const supabase = await createClient();
  const { data: players } = await supabase
    .from("players")
    .select("*")
    .order("display_name");

  return (
    <div className="space-y-6">
      <PageHeader
        title="Player registry"
        description="Global players used for rosters and transfers"
      />
      <PlayersRegistry initialPlayers={players ?? []} />
    </div>
  );
}
