import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import * as api from "../helpers/api"; import Icon from "./Icon"; import { generateDialog } from "./Dialog"; import GitHubBadge from "./GitHubBadge"; import "../less/about-site-dialog.less"; type Props = DialogProps; const AboutSiteDialog: React.FC = ({ destroy }: Props) => { const { t } = useTranslation(); const [profile, setProfile] = useState(); useEffect(() => { try { api.getSystemStatus().then(({ data }) => { const { data: { profile }, } = data; setProfile(profile); }); } catch (error) { setProfile({ mode: "dev", version: "0.0.0", }); } }, []); const handleCloseBtnClick = () => { destroy(); }; return ( <>

🤠 {t("common.about")}

{t("slogan")}


{profile !== undefined && ( <> {t("common.version")}: {profile?.version}-{profile?.mode} 🎉 )}
); }; export default function showAboutSiteDialog(): void { generateDialog( { className: "about-site-dialog", }, AboutSiteDialog ); }