feat: add reusable prompt dialogs for frontend forms

This commit is contained in:
cesnimda
2026-03-22 14:14:29 +01:00
parent 758d2c6a0b
commit abac48847c
6 changed files with 134 additions and 8 deletions
@@ -194,7 +194,7 @@ export default function JobDetailsDialog({ open, jobId, onClose }: Props) {
disabled={refreshingAi}
onClick={async () => {
if (!jobId) return;
if (!window.confirm("Overwrite the current summary and skills with a freshly generated version?")) return;
if (!(await confirmAction("Overwrite the current summary and skills with a freshly generated version?", { title: "Refresh AI summary", confirmLabel: "Refresh" }))) return;
setRefreshingAi(true);
try {
const res = await api.post<JobApplication>(`/jobapplications/${jobId}/refresh-ai`);
@@ -123,6 +123,7 @@ function statusTone(status: string): string {
export default function JobTable({ refreshToken, pageSize, onPageSizeChange, columns, onColumnsChange, mode = "jobs" }: Props) {
const theme = useTheme();
const { toast } = useToast();
const { confirmAction } = useDialogActions();
const location = useLocation();
const navigate = useNavigate();
const [jobs, setJobs] = useState<JobApplication[]>([]);
@@ -400,3 +401,8 @@ export default function JobTable({ refreshToken, pageSize, onPageSizeChange, col
</Box>
);
}
s); setStatusAnchor(null); setStatusJobId(null); }}>Set {s}</MenuItem>)}
</Menu>
</Box>
);
}