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.isActive ? 'Active' : 'Inactive'}
{schedule.cron.minute}
Minute
{schedule.cron.hour}
Hour
{schedule.cron.dayOfMonth}
Day (Month)
*
Month
{schedule.cron.dayOfWeek}
Day (Week)
{schedule.isActive ? 'Active' : 'Inactive'}