feat/Update_Controllers_to_Allow_for_Premium_Membership

This commit is contained in:
cesnimda
2026-08-03 09:17:28 +02:00
parent de937d25dc
commit c3f4a57195
187 changed files with 26062 additions and 991 deletions
@@ -28,6 +28,7 @@ import {
} from "@mui/material";
import CloseIcon from "@mui/icons-material/Close";
import { useAccountPlan } from "../accountPlan";
import UploadFileOutlinedIcon from "@mui/icons-material/UploadFileOutlined";
import { api, getApiErrorMessage } from "../api";
@@ -104,6 +105,7 @@ function normalizeLanguage(value?: string | null) {
}
export default function AddJobModal({ open, onClose, onCreated, initialUrl }: Props) {
const { canUseAi } = useAccountPlan();
const { toast } = useToast();
const { t, language } = useI18n();
@@ -351,7 +353,7 @@ export default function AddJobModal({ open, onClose, onCreated, initialUrl }: Pr
dateApplied,
});
if (response.data?.id && generateTailoredCv) {
if (response.data?.id && generateTailoredCv && canUseAi) {
try {
await api.post(`/jobapplications/${response.data.id}/generate-tailored-cv-draft`);
} catch (error: any) {
@@ -608,8 +610,8 @@ export default function AddJobModal({ open, onClose, onCreated, initialUrl }: Pr
</Typography>
</Box>
{activeStep === 2 ? <>
<FormControlLabel control={<Checkbox checked={generateTailoredCv} onChange={(event) => setGenerateTailoredCv(event.target.checked)} />} label="Generate a tailored CV draft after creating this job" />
<Typography variant="caption" sx={{ color: "text.secondary", mt: -1 }}>Uses your reviewed Career Profile and keeps the result as an editable suggestion.</Typography>
<FormControlLabel control={<Checkbox disabled={!canUseAi} checked={generateTailoredCv && canUseAi} onChange={(event) => setGenerateTailoredCv(event.target.checked)} />} label={canUseAi ? "Generate a tailored CV draft after creating this job" : "Tailored CV generation requires Pro"} />
<Typography variant="caption" sx={{ color: "text.secondary", mt: -1 }}>{canUseAi ? "Uses your reviewed Career Profile and keeps the result as an editable suggestion." : "Create and track the job normally; no AI operation will be started."}</Typography>
{uploadField("resume", t("addJobModalResume"), t("addJobModalResumeHelp"))}
</> : null}
{activeStep === 3 ? uploadField("coverLetter", t("addJobModalCoverLetter"), t("addJobModalCoverLetterHelp")) : null}