import {ColumnConfig} from '@common/datatable/column-config'; import {Trans} from '@common/i18n/trans'; import {NameWithAvatar} from '@common/datatable/column-templates/name-with-avatar'; import {BooleanIndicator} from '@common/datatable/column-templates/boolean-indicator'; import {FormattedNumber} from '@common/i18n/formatted-number'; import {Tooltip} from '@common/ui/tooltip/tooltip'; import {IconButton} from '@common/ui/buttons/icon-button'; import React from 'react'; import {ScheduleLogItem} from '@common/admin/logging/schedule/schedule-log-item'; import {useRerunScheduledCommand} from '@common/admin/logging/schedule/use-rerurun-scheduled-command'; import {EventRepeatIcon} from '@common/icons/material/EventRepeat'; import {FormattedRelativeTime} from '@common/i18n/formatted-relative-time'; export const ScheduleDatatableColumns: ColumnConfig[] = [ { key: 'command', allowsSorting: true, visibleInMode: 'all', width: 'flex-3 min-w-200', header: () => , body: item => ( ), }, { key: 'ran_at', allowsSorting: true, header: () => , body: item => , }, { key: 'duration', allowsSorting: true, header: () => , body: item => `${item.duration}ms`, }, { key: 'exit_code', allowsSorting: true, header: () => , body: item => , }, { key: 'count_in_last_hour', allowsSorting: true, header: () => , body: item => , }, { key: 'actions', header: () => , hideHeader: true, align: 'end', width: 'w-42 flex-shrink-0', visibleInMode: 'all', body: item => , }, ]; interface RerunButtonProps { item: ScheduleLogItem; } function RerunButton({item}: RerunButtonProps) { const rerunCommand = useRerunScheduledCommand(); return ( }> { rerunCommand.mutate({id: item.id}); }} > ); }