mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-27 17:57:24 -05:00
32 lines
972 B
TypeScript
32 lines
972 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { Redirect } from "~/components/Redirect";
|
|
import { tournamentRegisterPage } from "~/utils/urls";
|
|
import { TournamentStream } from "../components/TournamentStream";
|
|
import { useTournament } from "./to.$id";
|
|
|
|
export default function TournamentStreamsPage() {
|
|
const { t } = useTranslation(["tournament"]);
|
|
const tournament = useTournament();
|
|
|
|
if (!tournament.hasStarted || tournament.everyBracketOver) {
|
|
return <Redirect to={tournamentRegisterPage(tournament.ctx.id)} />;
|
|
}
|
|
|
|
if (tournament.streams.length === 0) {
|
|
return (
|
|
<div className="text-center text-lg font-semi-bold text-lighter">
|
|
{t("tournament:streams.none")}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
// TODO: link to user page, later tournament team page?
|
|
return (
|
|
<div className="stack horizontal lg flex-wrap justify-center">
|
|
{tournament.streams.map((stream) => (
|
|
<TournamentStream key={stream.twitchUserName} stream={stream} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|