import { getMonitoringAgent, getScheduleLabel, getScheduleMarks, } from '~/data/monitoring-agents.utils' type AgentWatchScheduleProps = { id: string } function DaySchedule({ marks, cadence, }: { marks: ReturnType['marks'] cadence: string }) { const labeled = marks.filter((mark) => mark.label) return (
{labeled.map((mark) => { const index = marks.findIndex((item) => item.key === mark.key) return ( {mark.label} ) })}
{marks.map((mark) => ( ))}
) } function WeekSchedule({ marks, cadence, }: { marks: ReturnType['marks'] cadence: string }) { return (
{marks.map((mark) => (
{mark.label}
))}
) } function AgentWatchSchedule({ id }: AgentWatchScheduleProps) { const agent = getMonitoringAgent(id) const { window, marks } = getScheduleMarks(agent.schedule.intervalMinutes) const title = getScheduleLabel(agent) return (

{title}

{window === 'week' ? ( ) : ( )}

{agent.schedule.onDemand}

) } export { AgentWatchSchedule } export type { AgentWatchScheduleProps }