mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-04 19:21:51 +00:00
24 lines
753 B
TypeScript
24 lines
753 B
TypeScript
"use client";
|
|
|
|
import { getScanScheduleLabel } from "@/components/scans/scans.utils";
|
|
import { StackedCell } from "@/components/shadcn";
|
|
import { formatLocalTimeWithZone } from "@/lib/date-utils";
|
|
import type { ScanProps } from "@/types";
|
|
|
|
// Trigger label on top, cadence (in the browser's timezone) underneath.
|
|
export function ScheduleCell({ scan }: { scan: ScanProps }) {
|
|
const schedule = scan.providerSchedule;
|
|
const localTime = formatLocalTimeWithZone(schedule?.nextScanAt ?? null);
|
|
|
|
return (
|
|
<StackedCell
|
|
primary={getScanScheduleLabel(scan.attributes.trigger)}
|
|
secondary={
|
|
schedule
|
|
? `${schedule.cadence ?? schedule.summary}${localTime ? ` @ ${localTime}` : ""}`
|
|
: undefined
|
|
}
|
|
/>
|
|
);
|
|
}
|