import TextField from "@mui/material/TextField";
import MenuItem from "@mui/material/MenuItem";
const maxMemSupported = 10;
export const memoryOptions = new Array(2 * maxMemSupported)
  .fill(0)
  .map((v, i) => (i + 1) * 512);

export default function Option(props) {
  const { value, onChange } = props;
  return (
    <TextField
      label="Memory"
      onChange={onChange}
      value={value ?? memoryOptions[1]}
      select
      required
      SelectProps={{ MenuProps: { sx: { maxHeight: "20rem" } } }}
    >
      {memoryOptions.map((o, i) => (
        <MenuItem value={o} key={i}>{`${o / 1024} Gi`}</MenuItem>
      ))}
    </TextField>
  );
}
