/* * Copyright (C) 2025 Aleksander WilczyƄski (aleks@alekswilc.dev) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * See LICENSE for more. */ import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { TActiveStationPlayersData } from "../../../types/active.ts"; import { UserIcons } from "../../mini/icons/UserIcons.tsx"; import { toast } from "react-toastify"; export const ActiveStationTable = ({ stations }: { stations: TActiveStationPlayersData[] }) => { const { t } = useTranslation(); const report = (data: TActiveStationPlayersData) => { toast.info(t("log.toasts.report"), { autoClose: 5000, }); void navigator.clipboard.writeText(`;user: \`${ data.player.username }\`\n;steam: \`https://steamcommunity.com/profiles/${ data.player.id }\`\n;server: \`${ data.server.toUpperCase() }\`\n;station: \`${ data.stationName }\`\n;link: https://${ location.hostname }/profile/${data.player.id}\n\n`); }; return (
{ stations.map((station) => { return
Player

{ station.player.username }

{ t("log.station.station", { name: station.stationName, short: station.stationShort }) }

{ t("log.station.server", { server: station.server.toUpperCase() }) }

{ t("log.buttons.profile") } report(station) } className="cursor-pointer inline-flex items-center justify-center rounded-md bg-danger py-2 px-5 text-center font-medium text-white hover:bg-opacity-50 lg:px-4 xl:px-5" > { t("log.buttons.report") }
; }) }
); };