blob: 04645cd5baf77ec075e1d55efb85531ef1da9e76 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import React from 'react';
import {
FormControl, InputLabel, MenuItem, Select,
} from '@mui/material';
import { useTranslation } from '../../common/components/LocalizationProvider';
import { useFilterStyles } from './ReportFilter';
const ColumnSelect = ({
columns, setColumns, columnsArray, columnsObject,
}) => {
const classes = useFilterStyles();
const t = useTranslation();
return (
<div className={classes.item}>
<FormControl variant="filled" fullWidth>
<InputLabel>{t('sharedColumns')}</InputLabel>
<Select
value={columns}
onChange={(e) => setColumns(e.target.value)}
renderValue={(it) => it.length}
multiple
>
{columnsArray
? columnsArray.map(([key, string]) => (
<MenuItem key={key} value={key}>{t(string)}</MenuItem>
))
: Object.keys(columnsObject).map((key) => (
<MenuItem key={key} value={key}>{columnsObject[key].name}</MenuItem>
))}
</Select>
</FormControl>
</div>
);
};
export default ColumnSelect;
|