/* eslint-disable react-x/no-array-index-key */ import AddIcon from "@mui/icons-material/Add"; import ClearIcon from "@mui/icons-material/Clear"; import { Alert, IconButton, InputAdornment, TextField, Tooltip, } from "@mui/material"; import { VMInfo } from "../../api/VMApi"; import { useConfirm } from "../../hooks/providers/ConfirmDialogProvider"; import { EditSection } from "./EditSection"; export function OEMStringFormWidget(p: { vm: VMInfo; editable: boolean; onChange?: () => void; }): React.ReactElement { const confirm = useConfirm(); const handleDeleteOEMString = async (num: number) => { if (!(await confirm("Do you really want to delete this entry?"))) return; p.vm.oem_strings.splice(num, 1); p.onChange?.(); }; if (!p.editable && p.vm.oem_strings.length === 0) return <>; return ( { p.vm.oem_strings.push(""); p.onChange?.(); }} > ) : ( <> ) } > You can use the{" "} dmidecode {" "} tool on Linux to extract these strings on the guest. {p.vm.oem_strings.map((s, num) => ( { p.vm.oem_strings[num] = e.target.value; p.onChange?.(); }} style={{ marginTop: "5px" }} slotProps={{ input: { endAdornment: p.editable ? ( handleDeleteOEMString(num)}> ) : undefined, }, }} /> ))} ); }