mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-10 12:44:47 -05:00
* Add DB tables
* Toggle TO Tools in new calendar event page
* TO tools page initial
* Add counter pick map pool UI
* Save tie breaker map pool
* Save team name
* Layout initial
* Load users own team
* Make team name input required
* Rename team
* Divide to sections
* Submit team map pool
* New style for counter pick map pool section expand
* Fix tiebreaker map pool not saved when new event made
* Split to many forms
* According for team name
* Small UI consistency tweaks
* Add explanation to tie breaker maps
* Remove redundant prop
* Fix new calendar event todos
* Use required hidden input component in new build page
* Fix to tools page showing even when toToolsEnabled = 0
* Delete team
* Map list generation tests initial
* Add tournament map list generation tests
* First version of map list generation
* Add seeded RNG
* Rearrange files
* Generation with strats initial
* Default map pool + allow one team not to have any maps
* Implement map generation via backtracking
* Make order of stages irrelevant
* Add one more TODO
* Seed
* Fixes
* Tournament map list generator initial
* More functional maplist
* Fix any
* Persist in search params initial
* Add date to calendar seed
* Revert "Persist in search params initial"
This reverts commit f01a9e6982.
* Allow admin to start tournament
* Rate maplist instead of optimal / suboptimal
* Add fallback if map list generation errors out
* Hide TO Tools if not admin
* Submit team roster and delete members
* Teams page
* Give roster s p a c e
* Clear user combobox on sent + layout tweaks
* Gracefully handle updating after tournament has started
* Add title
* Persist map list in search params
* Add i18n
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import clsx from "clsx";
|
|
import type * as React from "react";
|
|
import { AlertIcon } from "./icons/Alert";
|
|
import { ErrorIcon } from "./icons/Error";
|
|
import { CheckmarkIcon } from "./icons/Checkmark";
|
|
import { assertUnreachable } from "~/utils/types";
|
|
|
|
export type AlertVariation = "INFO" | "WARNING" | "ERROR" | "SUCCESS";
|
|
|
|
export function Alert({
|
|
children,
|
|
textClassName,
|
|
alertClassName,
|
|
variation = "INFO",
|
|
tiny = false,
|
|
}: {
|
|
children: React.ReactNode;
|
|
textClassName?: string;
|
|
alertClassName?: string;
|
|
variation?: AlertVariation;
|
|
tiny?: boolean;
|
|
}) {
|
|
return (
|
|
<div
|
|
className={clsx("alert", alertClassName, {
|
|
tiny,
|
|
warning: variation === "WARNING",
|
|
error: variation === "ERROR",
|
|
success: variation === "SUCCESS",
|
|
})}
|
|
>
|
|
<Icon variation={variation} />{" "}
|
|
<div className={textClassName}>{children}</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function Icon({ variation }: { variation: AlertVariation }) {
|
|
switch (variation) {
|
|
case "INFO":
|
|
return <AlertIcon />;
|
|
case "WARNING":
|
|
return <AlertIcon />;
|
|
case "ERROR":
|
|
return <ErrorIcon />;
|
|
case "SUCCESS":
|
|
return <CheckmarkIcon />;
|
|
default:
|
|
assertUnreachable(variation);
|
|
}
|
|
}
|