Files
job-search/web/src/components/styles.ts
T
bwilliams 3bb2711276 Added the closing date to the table, and narrowed its columns to fit
The backend's new closing_date, the bid deadline, is a Closing column
before the start and end dates, which are now the contract's: the
details dialog calls them Contract start and Contract end. Closing
sorts soonest first, with no date last, and shows the time it closes
in the cell's tooltip and in the dialog. The API types are regenerated
for it.

To make room, the SME suitable column is now an SME badge beside the
status, shown only when it's suitable, so the Status column sorts by
status alone and a stored SME sort goes back to the default. The Mark
column is narrower. An opportunity without a status is shown as
Unknown, in the colours of the statuses without their own, such as
Cancelled and Withdrawn, rather than as a blank badge or a dash.
2026-10-21 14:47:56 +01:00

35 lines
1.5 KiB
TypeScript

import type { OpportunityMark } from '@/types/Annotations';
// Tailwind only generates classes it can see written out in full, so these
// lookups list every class literally rather than building names at runtime.
/**
* Badge colours for each known status; the others get a neutral badge, as
* cancelled, withdrawn and unknown (empty) ones do.
*/
export const STATUS_BADGE: Record<string, string> = {
planning: 'bg-status-planning-soft text-status-planning',
planned: 'bg-status-planning-soft text-status-planning',
active: 'bg-status-open-soft text-status-open',
complete: 'bg-accent-soft text-accent',
};
/** The badge classes for status. */
export const statusBadge = (status: string): string => STATUS_BADGE[status] ?? 'bg-paper text-ink';
/** Fill colour for each mark: row stripe segments, menu dots, pills. */
export const MARK_BG: Record<OpportunityMark, string> = {
interested: 'bg-mark-interested',
skipped: 'bg-mark-skipped',
bid_submitted: 'bg-mark-bid-submitted',
lost: 'bg-mark-lost',
won: 'bg-mark-won',
};
export const input =
'w-full rounded-md border border-line bg-surface px-2.5 py-2 placeholder:text-muted disabled:bg-paper';
export const buttonQuiet =
'rounded-md border border-line bg-surface px-3.5 py-1.5 hover:enabled:border-muted disabled:opacity-60 disabled:text-muted';
export const buttonPrimary = 'rounded-md bg-accent px-3.5 py-1.5 font-semibold text-on-accent';
export const linkButton = 'text-accent underline';
export const fieldLabel = 'mb-1.5 block p-0 text-sm font-semibold';