-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathAnswerDetailDialog.jsx
More file actions
55 lines (53 loc) · 1.78 KB
/
AnswerDetailDialog.jsx
File metadata and controls
55 lines (53 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// src/components/AnswerDetailDialog.jsx
import React from "react";
import {
Dialog,
DialogHeader,
DialogBody,
DialogFooter,
Typography,
Button,
} from "@material-tailwind/react";
const AnswerDetailDialog = ({ open, onClose, data }) => {
if (!data) return null;
return (
<Dialog open={open} handler={onClose} size="md">
<DialogHeader>Chi tiết câu trả lời</DialogHeader>
<DialogBody className="space-y-4">
<Typography variant="small"><strong>Farm ID:</strong> {data.farmId}</Typography>
<Typography variant="small"><strong>Question ID:</strong> {data.questionId}</Typography>
<Typography variant="small">
<strong>Selected Options:</strong> {data.selectedOptions?.join(", ") || "—"}
</Typography>
<Typography variant="small"><strong>Other Text:</strong> {data.otherText || "—"}</Typography>
<Typography variant="small"><strong>User ID:</strong> {data.userId || "—"}</Typography>
<div>
<strong>Tệp đính kèm:</strong>
<div className="mt-1">
{data.uploadedFiles?.length > 0 ? (
data.uploadedFiles.map((file, idx) => (
<a
key={idx}
href={file}
target="_blank"
rel="noopener noreferrer"
className="block text-blue-600 underline"
>
File {idx + 1}
</a>
))
) : (
<Typography variant="small">Không có</Typography>
)}
</div>
</div>
</DialogBody>
<DialogFooter>
<Button variant="outlined" onClick={onClose}>
Đóng
</Button>
</DialogFooter>
</Dialog>
);
};
export default AnswerDetailDialog;