import { useEffect, useState } from "react"; import * as api from "../helpers/api"; import useI18n from "../hooks/useI18n"; import Only from "./common/OnlyWhen"; import Icon from "./Icon"; import { generateDialog } from "./Dialog"; import GitHubBadge from "./GitHubBadge"; import "../less/about-site-dialog.less"; interface Props extends DialogProps {} const AboutSiteDialog: React.FC = ({ destroy }: Props) => { const { t } = useI18n(); 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")} Memos

{t("slogan")}


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