ตัวอย่างการใช้งาน
import { Computer } from "@mui/icons-material"
import { Box } from "@mui/material"
import React from "react"
import { MainForm } from "./index"
export default function ComputerForm() {
const fields = [
{ dataLabel: "ข้อมูลพยานหลักฐาน", type: "header", dataKey: "header", size: { xs: 12, sm: 12 } },
{ dataLabel: "ประเภทคอมพิวเตอร์", type: "text", dataKey: "typeOfComputer", dataPlaceHolder: "เครื่องคอมพิวเตอร์แบบตั้งโต๊ะ (เครื่องคอมพิวเตอร์แบบประกอบเอง)", size: { xs: 12, sm: 6 }, value: "" },
{ dataLabel: "Serial Number", type: "text", dataKey: "serialNo", dataPlaceHolder: "XXXXXXX", size: { xs: 12, sm: 6 }, value: "" },
{ dataLabel: "ยี่ห้อ", type: "text", dataKey: "brand", dataPlaceHolder: "ACER", size: { xs: 12, sm: 4 }, value: "" },
{ dataLabel: "รุ่น/โมเดล", type: "text", dataKey: "model", dataPlaceHolder: "PREDATER DESKTOP G9-591", size: { xs: 12, sm: 5 }, value: "" },
{ dataLabel: "สี", type: "text", dataKey: "color", dataPlaceHolder: "ดำ", size: { xs: 12, sm: 3 }, value: "" },
{ dataLabel: "เครื่องมือตรวจพิสูจน์ฯ", type: "header", dataKey: "header", size: { xs: 12, sm: 12 } },
{ dataLabel: "เครื่องมือตรวจพิสูจน์", type: "array", dataKey: "forensicTools", dataPlaceHolder: "XXXXXXXXXXXX", size: { xs: 12, sm: 12 }, value: [""] },
{ dataLabel: "CHECKBOX", type: "header", dataKey: "header", size: { xs: 12, sm: 12 } },
{ dataLabel: "สร้างค่า Hash", type: "checkbox", dataKey: "isHash", size: { xs: 12, sm: 4 }, value: false },
{ dataLabel: "ค่า HASH", type: "text", dataKey: "hashValue", dataPlaceHolder: "XXXXXXX", size: { xs: 12, sm: 4 }, value: "" },
{ dataLabel: "ประเภทค่า Hash", type: "dropdown", dataKey: "selectedHash", dataPlaceHolder: "กรุณาเลือกรูปแบบค่า Hash", size: { xs: 12, sm: 4 }, value: "SHA1", dataOptions: ["SHA1", "SHA256", "MD5"] },
]
return (
<Box sx={{ background: "#000" }}>
<MainForm icon={<Computer sx={{ color: "#fff", fontSize: "2rem" }} />} isSubmitable initialFields={fields} apiPath={"http://targetapi/report"} title="รายงานสำหรับคอมพิวเตอร์" reportPrefix="ev-computer" reportPostfix="serialNo" />
</Box>
)
}