-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29269eb
commit 22add09
Showing
2 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/material/Box'; | ||
import InputLabel from '@mui/material/InputLabel'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import FormControl from '@mui/material/FormControl'; | ||
import Select, { SelectChangeEvent } from '@mui/material/Select'; | ||
|
||
interface Props { | ||
logFilterValue: number; | ||
onLogFilterChange: (newLogFilterValue: number) => void; | ||
} | ||
|
||
const BasicSelect: React.FC<Props> = ({ logFilterValue, onLogFilterChange }) => { | ||
const handleChange = (event: SelectChangeEvent) => { | ||
const newLogFilterValue = event.target.value as unknown as number; | ||
onLogFilterChange(newLogFilterValue); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ minWidth: 120 }}> | ||
<FormControl fullWidth> | ||
<InputLabel id="log-filter-id">Minimum Log Filter</InputLabel> | ||
<Select | ||
labelId="log-filter-id" | ||
id="log-filter-label" | ||
value={logFilterValue.toString()} | ||
label="Minimum Log Filter" | ||
onChange={handleChange} | ||
> | ||
<MenuItem value={7}>DEBUG</MenuItem> | ||
<MenuItem value={6}>INFO</MenuItem> | ||
<MenuItem value={5}>NOTICE</MenuItem> | ||
<MenuItem value={4}>WARNING</MenuItem> | ||
<MenuItem value={3}>ERROR</MenuItem> | ||
<MenuItem value={2}>CRITICAL</MenuItem> | ||
<MenuItem value={1}>ALERT</MenuItem> | ||
<MenuItem value={0}>EMERGENCY</MenuItem> | ||
</Select> | ||
</FormControl> | ||
</Box> | ||
); | ||
} | ||
|
||
export default BasicSelect; |