From 079fd58b16560970bf4af301cc83e40de9ae21fa Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 24 Oct 2024 01:39:28 +0530 Subject: [PATCH] wip: recording settings --- src/components/molecules/RecordingsTable.tsx | 33 ++++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/components/molecules/RecordingsTable.tsx b/src/components/molecules/RecordingsTable.tsx index 00386ca3..cc9c1770 100644 --- a/src/components/molecules/RecordingsTable.tsx +++ b/src/components/molecules/RecordingsTable.tsx @@ -10,7 +10,7 @@ import TableRow from '@mui/material/TableRow'; import { useEffect } from "react"; import { WorkflowFile } from "maxun-core"; import { IconButton, Button, Box, Typography, TextField } from "@mui/material"; -import { Schedule, DeleteForever, Edit, PlayCircle } from "@mui/icons-material"; +import { Schedule, DeleteForever, Edit, PlayCircle, Settings } from "@mui/icons-material"; import LinkIcon from '@mui/icons-material/Link'; import { useGlobalInfoStore } from "../../context/globalInfo"; import { deleteRecordingFromStorage, getStoredRecordings } from "../../api/storage"; @@ -26,7 +26,7 @@ import { GenericModal } from '../atoms/GenericModal'; */ interface Column { - id: 'interpret' | 'name' | 'delete' | 'schedule' | 'integrate'; + id: 'interpret' | 'name' | 'delete' | 'schedule' | 'integrate' | 'settings'; label: string; minWidth?: number; align?: 'right'; @@ -68,6 +68,11 @@ const columns: readonly Column[] = [ label: 'Delete', minWidth: 80, }, + { + id: 'settings', + label: 'Settings', + minWidth: 80, + }, ]; interface Data { @@ -84,9 +89,10 @@ interface RecordingsTableProps { handleRunRecording: (id: string, fileName: string, params: string[]) => void; handleScheduleRecording: (id: string, fileName: string, params: string[]) => void; handleIntegrateRecording: (id: string, fileName: string, params: string[]) => void; + handleSettingsRecording: (id: string, fileName: string, params: string[]) => void; } -export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handleScheduleRecording, handleIntegrateRecording }: RecordingsTableProps) => { +export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handleScheduleRecording, handleIntegrateRecording, handleSettingsRecording }: RecordingsTableProps) => { const [page, setPage] = React.useState(0); const [rowsPerPage, setRowsPerPage] = React.useState(10); const [rows, setRows] = React.useState([]); @@ -256,6 +262,12 @@ export const RecordingsTable = ({ handleEditRecording, handleRunRecording, handl ); + case 'settings': + return ( + + handleSettingsRecording(row.id, row.name, row.params || [])} /> + + ); default: return null; } @@ -347,3 +359,18 @@ const IntegrateButton = ({ handleIntegrate }: IntegrateButtonProps) => { ) } + +interface SettingsButtonProps { + handleSettings: () => void; +} + +const SettingsButton = ({ handleSettings }: SettingsButtonProps) => { + return ( + { + handleSettings(); + }} + > + + + ) +} \ No newline at end of file