import { filesize } from "filesize"; import { IsoFile } from "../../api/IsoFilesApi"; import { SelectInput } from "./SelectInput"; import { Avatar, IconButton, ListItem, ListItemAvatar, ListItemText, Tooltip, } from "@mui/material"; import DeleteIcon from "@mui/icons-material/Delete"; import { mdiDisc } from "@mdi/js"; import Icon from "@mdi/react"; export function VMSelectIsoInput(p: { editable: boolean; isoList: IsoFile[]; value?: string; onChange: (newVal?: string) => void; }): React.ReactElement { if (!p.value && !p.editable) return <>; if (p.value) { const iso = p.isoList.find((d) => d.filename === p.value); return ( { p.onChange(undefined); }} > ) } > ); } return ( { return { label: `${i.filename} ${filesize(i.size)}`, value: i.filename, }; }), ]} /> ); }