Add reminder emails and AI CV improvement tools

This commit is contained in:
cesnimda
2026-03-23 21:46:37 +01:00
parent 66d924e880
commit 5a31f86e4d
9 changed files with 200 additions and 5 deletions
+21 -1
View File
@@ -51,6 +51,7 @@ export default function ProfilePage() {
const [me, setMe] = useState<MeResponse | null>(null);
const [loading, setLoading] = useState(false);
const [uploadingCv, setUploadingCv] = useState(false);
const [improvingCv, setImprovingCv] = useState(false);
const [uploadingAvatar, setUploadingAvatar] = useState(false);
const [avatarFile, setAvatarFile] = useState<File | null>(null);
const [cropOpen, setCropOpen] = useState(false);
@@ -247,9 +248,28 @@ export default function ProfilePage() {
}
}}
/>
<Button variant="outlined" disabled={!isLocal || uploadingCv} onClick={() => cvInputRef.current?.click()}>
<Button variant="outlined" disabled={!isLocal || uploadingCv || improvingCv} onClick={() => cvInputRef.current?.click()}>
{uploadingCv ? t("profileUploading") : t("profileUploadCv")}
</Button>
<Button
variant="outlined"
disabled={!isLocal || !profileCvText.trim() || uploadingCv || improvingCv}
onClick={async () => {
setImprovingCv(true);
try {
const res = await api.post<{ text?: string }>("/profile-cv/improve");
if (res.data?.text) setProfileCvText(res.data.text);
await loadProfile();
toast(t("profileCvImproved"), "success");
} catch (e: any) {
toast(String(e?.response?.data || e?.message || t("profileCvImproveFailed")), "error");
} finally {
setImprovingCv(false);
}
}}
>
{improvingCv ? t("profileCvImproving") : t("profileCvImprove")}
</Button>
<Button variant="text" disabled={!profileCvText.trim()} onClick={() => navigator.clipboard.writeText(profileCvText)}>
{t("profileCopyCvText")}
</Button>