| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import { makeStyles } from "@material-ui/styles";
- import FormControl from "@material-ui/core/FormControl";
- import InputLabel from "@material-ui/core/InputLabel";
- import MenuItem from "@material-ui/core/MenuItem";
- import Select from "@material-ui/core/Select";
- import * as React from "react";
- import SelectWindow from "../../components/SelectWindow";
- const useStyles = makeStyles({
- wrapper: {
- display: "inline-flex",
- },
- formControl: {
- margin: 8,
- minWidth: 120,
- },
- });
- function EditCloudCostControls({
- windowOptions,
- window,
- setWindow,
- aggregationOptions,
- aggregateBy,
- setAggregateBy,
- costMetricOptions,
- costMetric,
- setCostMetric,
- currencyOptions,
- currency,
- setCurrency,
- }) {
- const classes = useStyles();
- return (
- <div className={classes.wrapper}>
- <SelectWindow
- windowOptions={windowOptions}
- window={window}
- setWindow={setWindow}
- />
- <FormControl className={classes.formControl}>
- <InputLabel id="aggregation-select-label">Breakdown</InputLabel>
- <Select
- id="aggregation-select"
- value={aggregateBy}
- onChange={(e) => {
- setAggregateBy(e.target.value);
- }}
- >
- {aggregationOptions.map((opt) => (
- <MenuItem key={opt.value} value={opt.value}>
- {opt.name}
- </MenuItem>
- ))}
- </Select>
- </FormControl>
- <FormControl className={classes.formControl}>
- <InputLabel id="costMetric-label">Cost Metric</InputLabel>
- <Select
- id="costMetric"
- value={costMetric}
- onChange={(e) => setCostMetric(e.target.value)}
- >
- {costMetricOptions.map((opt) => (
- <MenuItem key={opt.value} value={opt.value}>
- {opt.name}
- </MenuItem>
- ))}
- </Select>
- </FormControl>
- <FormControl className={classes.formControl}>
- <InputLabel id="currency-label">Currency</InputLabel>
- <Select
- id="currency"
- value={currency}
- onChange={(e) => setCurrency(e.target.value)}
- >
- {currencyOptions?.map((currency) => (
- <MenuItem key={currency} value={currency}>
- {currency}
- </MenuItem>
- ))}
- </Select>
- </FormControl>
- </div>
- );
- }
- export default React.memo(EditCloudCostControls);
|