feat(jobs): expose discovery provenance
CI and Deploy / test (pull_request) Successful in 4m15s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-10 10:38:01 +02:00
parent 986f58522b
commit 511a9f6795
5 changed files with 58 additions and 9 deletions
+26 -3
View File
@@ -1,11 +1,26 @@
import { FormEvent, useState } from "react";
import { Alert, Box, Button, Card, CardActions, CardContent, CircularProgress, Stack, TextField, Typography } from "@mui/material";
import { Alert, Box, Button, Card, CardActions, CardContent, Chip, CircularProgress, Stack, TextField, Typography } from "@mui/material";
import SearchIcon from "@mui/icons-material/Search";
import AddIcon from "@mui/icons-material/Add";
import { useNavigate } from "react-router-dom";
import { api } from "../api";
type DiscoveredJob = { id: string; title: string; company?: string; location?: string; modifiedAt?: string; url: string; source: string; countryCode: string; };
type DiscoveredJob = {
id: string;
title: string;
company?: string;
location?: string;
modifiedAt?: string;
deadline?: string;
url: string;
source: string;
sourceName?: string;
acquisitionType?: string;
retrievedAt?: string;
countryCode: string;
};
const formatDate = (value?: string) => value ? new Date(value).toLocaleDateString() : null;
export default function JobDiscoveryPage() {
const navigate = useNavigate();
@@ -38,9 +53,17 @@ export default function JobDiscoveryPage() {
{jobs.map((job) => (
<Card key={job.id} variant="outlined">
<CardContent>
<Chip label={job.sourceName || job.source.toUpperCase()} size="small" color="primary" variant="outlined" sx={{ mb: 1 }} />
<Typography variant="h6" sx={{ fontWeight: 800 }}>{job.title}</Typography>
<Typography color="text.secondary">{[job.company, job.location].filter(Boolean).join(" · ")}</Typography>
<Typography variant="caption" color="text.secondary">NAV · Norway{job.modifiedAt ? " · Updated " + new Date(job.modifiedAt).toLocaleDateString() : ""}</Typography>
<Stack spacing={0.25} sx={{ mt: 1 }}>
<Typography variant="caption" color="text.secondary">
{job.acquisitionType === "searched" ? "Searched listing" : "Source type unavailable"}
{formatDate(job.retrievedAt) ? ` · Retrieved ${formatDate(job.retrievedAt)}` : ""}
</Typography>
{formatDate(job.modifiedAt) ? <Typography variant="caption" color="text.secondary">Listing updated {formatDate(job.modifiedAt)}</Typography> : null}
{formatDate(job.deadline) ? <Typography variant="body2" color="text.primary">Application deadline: {formatDate(job.deadline)}</Typography> : null}
</Stack>
</CardContent>
<CardActions>
<Button href={job.url} target="_blank" rel="noreferrer">View listing</Button>