import React from 'react'; import { Schedule } from '@/api/server/schedules/getServerSchedules'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCalendarAlt } from '@fortawesome/free-solid-svg-icons'; import { format } from 'date-fns'; import tw from 'twin.macro'; export default ({ schedule }: { schedule: Schedule }) => ( <>
{schedule.name}
Last run at: {schedule.lastRunAt ? format(schedule.lastRunAt, 'MMM Do [at] h:mma') : 'never'}
{schedule.cron.minute}
Minute
{schedule.cron.hour}
Hour
{schedule.cron.dayOfMonth}
Day (Month)
*
Month
{schedule.cron.dayOfWeek}
Day (Week)
{schedule.isActive ? 'Active' : 'Inactive'}