Skip to content

Commit

Permalink
Merge pull request #513 from AI4Bharat/develop2
Browse files Browse the repository at this point in the history
Master-merge-5-12
  • Loading branch information
Shruti1229 authored Dec 5, 2023
2 parents e8ef243 + 139fd58 commit 6f82e1b
Show file tree
Hide file tree
Showing 26 changed files with 1,057 additions and 115 deletions.
1 change: 1 addition & 0 deletions src/common/DeleteDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const DeleteDialog = ({
Cancel
</Button>
<Button
color="error"
variant="contained"
onClick={() => submit()}
autoFocus
Expand Down
120 changes: 120 additions & 0 deletions src/common/TaskReopenDialog.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React from "react";

//Components
import {
Box,
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
Tooltip,
} from "@mui/material";
import Loader from "./Spinner";

const headers = ["Video Id", "Task Type", "Target Language", "Video Name"];

const TaskReopenDialog = ({
openDialog,
handleClose,
submit,
message,
loading,
taskReopenResponse,
}) => {
return (
<Dialog
open={openDialog}
onClose={handleClose}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
maxWidth={"md"}
PaperProps={{ style: { borderRadius: "10px" } }}
>
<DialogContent>
<DialogContentText id="alert-dialog-description">
{message}
{/* <br/> */}
{/* If you continue, corresponding Voice-Over task would be deleted. */}
{taskReopenResponse && (
<TableRow
style={{
borderLeft: `2px solid #E9F7EF`,
borderRight: `2px solid #E9F7EF`,
backgroundColor: "#fff",
}}
>
<TableCell colSpan={9} sx={{ borderBottom: "none" }}>
<Box>
<Table size="large">
<TableHead>
<TableRow
style={{
height: "60px",
}}
>
{headers.map((item, index) => {
return (
<TableCell key={index} sx={{ padding: "6px 16px" }}>
{item}
</TableCell>
);
})}
</TableRow>
</TableHead>
<TableBody>
{taskReopenResponse.map((item, index) => {
return (
<TableRow
key={index}
style={{
backgroundColor: "rgba(254, 191, 44, 0.1)",
height: "60px",
}}
>
<TableCell>{item.video_id}</TableCell>
<TableCell>{item.task_type}</TableCell>
<TableCell>
{item.target_language}
</TableCell>
<TableCell>{item.video_name}</TableCell>
</TableRow>
);
})}
</TableBody>
</Table>
</Box>
</TableCell>
</TableRow>
)}
</DialogContentText>
</DialogContent>
<DialogActions sx={{ p: "0 20px 20px 20px" }}>
<Button
variant="text"
onClick={handleClose}
sx={{ lineHeight: "1", borderRadius: "8px" }}
>
Cancel
</Button>
<Button
color="error"
variant="contained"
onClick={() => submit()}
autoFocus
sx={{ lineHeight: "1", borderRadius: "8px" }}
>
Reopen
{loading && <Loader size={20} margin="0 0 0 5px" color="secondary" />}
</Button>
</DialogActions>
</Dialog>
);
};

export default TaskReopenDialog;
Loading

0 comments on commit 6f82e1b

Please sign in to comment.