import clsx from "clsx"; import type { MetaFunction } from "react-router"; import { Link, useLoaderData } from "react-router"; import { metaTags, type SerializeFrom } from "~/utils/remix"; import { PLUS_SERVER_DISCORD_URL, userPage } from "~/utils/urls"; import { loader } from "../loaders/plus.voting.results.server"; import styles from "../plus-voting-results.module.css"; export { loader }; export const meta: MetaFunction = (args) => { return metaTags({ title: "Plus Server voting results", ogTitle: "Plus Server voting results", description: "Plus Server (+1, +2 and +3) voting results for the latest season.", location: args.location, }); }; export default function PlusVotingResultsPage() { const data = useLoaderData(); return (

Voting results for {data.lastCompletedVoting.month + 1}/ {data.lastCompletedVoting.year}

{data.ownScores && data.ownScores.length > 0 ? ( <>
Click{" "} here {" "} to join the Discord server. In some cases you might need to rejoin the server to get the correct role.
) : null} {!data.ownScores ? (
You weren't in the voting this month.
) : null} {data.results ? : null}
); } function Results({ results, }: { results: NonNullable["results"]>; }) { return (
S = Suggested user
{results.map((tiersResults) => (

+{tiersResults.tier}

{(["passed", "failed"] as const).map((status) => (

{status === "passed" ? "Passed" : "Didn't pass"} ( {tiersResults[status].length})

{tiersResults[status].map((user) => ( {user.wasSuggested ? ( S ) : null} {user.username} ))}
))}
))}
); }