feat(wip): scheduler

This commit is contained in:
karishmas6
2024-09-10 06:41:22 +05:30
parent fc56a395b8
commit 5107bc2b2b

View File

@@ -72,9 +72,10 @@ interface Data {
interface RecordingsTableProps {
handleEditRecording: (fileName: string) => void;
handleRunRecording: (fileName: string, params: string[]) => void;
handleScheduleRecording: (fileName: string, params: string[]) => void;
}
export const RecordingsTable = ({ handleEditRecording, handleRunRecording }: RecordingsTableProps) => {
export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handleScheduleRecording }: RecordingsTableProps) => {
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
const [rows, setRows] = React.useState<Data[]>([]);
@@ -171,7 +172,7 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording }: Rec
case 'schedule':
return (
<TableCell key={column.id} align={column.align}>
<ScheduleButton handleSchedule={() => {/* todo: schedule logic here */ }} />
<ScheduleButton handleSchedule={() => handleScheduleRecording(row.name, row.params || []) } />
</TableCell>
);
case 'delete':
@@ -230,18 +231,20 @@ const InterpretButton = ({ handleInterpret }: InterpretButtonProps) => {
)
}
interface ScheduleButtonProps {
handleSchedule: () => void;
}
const ScheduleButton = ({ handleSchedule }: ScheduleButtonProps) => {
return (
<IconButton
aria-label="schedule"
size="small"
onClick={handleSchedule}
<IconButton aria-label="add" size="small" onClick={() => {
handleSchedule();
}}
sx={{ '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}>
<Assignment />
<PlayCircle />
</IconButton>
);
};
)
}