Add links to admin team management table

This commit is contained in:
Kalle
2026-06-27 07:46:51 +03:00
parent c1eb4767b5
commit d923889eaa

View File

@@ -13,7 +13,7 @@ import {
X,
} from "lucide-react";
import * as React from "react";
import { useFetcher } from "react-router";
import { Link, useFetcher } from "react-router";
import { Avatar } from "~/components/Avatar";
import { LinkButton, SendouButton } from "~/components/elements/Button";
import { SendouMenu, SendouMenuItem } from "~/components/elements/Menu";
@@ -29,9 +29,10 @@ import { useTournament } from "~/features/tournament/routes/to.$id";
import type { Tournament } from "~/features/tournament-bracket/core/Tournament";
import type { TournamentDataTeam } from "~/features/tournament-bracket/core/Tournament.server";
import {
teamPage,
tournamentAdminRegistrationEditPage,
tournamentAdminRegistrationPage,
tournamentTeamPage,
userPage,
} from "~/utils/urls";
import { queryToUserIdentifier } from "~/utils/users";
import { ExportDialog } from "../components/ExportDialog";
@@ -165,19 +166,16 @@ function TeamRow({
<td>
<div className="stack horizontal sm items-center">
<Avatar size="xxs" url={logoSrc} identiconInput={team.name} />
{team.team ? (
<a
href={teamPage(team.team.customUrl ?? "")}
className={styles.teamName}
data-testid="team-name"
>
{team.name}
</a>
) : (
<span className={styles.teamName} data-testid="team-name">
{team.name}
</span>
)}
<Link
to={tournamentTeamPage({
tournamentId: tournament.ctx.id,
tournamentTeamId: team.id,
})}
className={styles.teamName}
data-testid="team-name"
>
{team.name}
</Link>
</div>
</td>
{!tournament.ctx.isFinalized ? (
@@ -193,14 +191,15 @@ function TeamRow({
return (
<td key={`player-${i}`}>
{member ? (
<span
<Link
to={userPage(member)}
className={clsx("stack horizontal xxs items-center", {
"font-bold": member.role === "OWNER",
})}
>
{member.role === "OWNER" ? "(C) " : null}
{member.username}
</span>
</Link>
) : null}
</td>
);