2023-01-05 02:34:22 +01:00
|
|
|
import * as React from 'react';
|
2023-01-28 05:10:59 +01:00
|
|
|
import {FormControl, Select} from "@mui/material";
|
2023-01-05 02:34:22 +01:00
|
|
|
import {useTranslation} from "react-i18next";
|
|
|
|
import MenuItem from "@mui/material/MenuItem";
|
|
|
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
|
|
import ListItemText from "@mui/material/ListItemText";
|
2023-01-24 02:04:04 +01:00
|
|
|
import {PermissionDenyAll, PermissionRead, PermissionReadWrite, PermissionWrite} from "./ReserveIcons";
|
2023-01-05 02:34:22 +01:00
|
|
|
|
|
|
|
const ReserveTopicSelect = (props) => {
|
|
|
|
const { t } = useTranslation();
|
|
|
|
const sx = props.sx || {};
|
|
|
|
return (
|
|
|
|
<FormControl fullWidth variant="standard" sx={sx}>
|
|
|
|
<Select
|
|
|
|
value={props.value}
|
|
|
|
onChange={(ev) => props.onChange(ev.target.value)}
|
|
|
|
aria-label={t("prefs_reservations_dialog_access_label")}
|
|
|
|
sx={{
|
|
|
|
"& .MuiSelect-select": {
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
paddingTop: "4px",
|
|
|
|
paddingBottom: "4px",
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<MenuItem value="deny-all">
|
2023-01-24 02:04:04 +01:00
|
|
|
<ListItemIcon><PermissionDenyAll/></ListItemIcon>
|
2023-01-05 02:34:22 +01:00
|
|
|
<ListItemText primary={t("prefs_reservations_table_everyone_deny_all")}/>
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem value="read-only">
|
2023-01-24 02:04:04 +01:00
|
|
|
<ListItemIcon><PermissionRead/></ListItemIcon>
|
2023-01-05 02:34:22 +01:00
|
|
|
<ListItemText primary={t("prefs_reservations_table_everyone_read_only")}/>
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem value="write-only">
|
2023-01-24 02:04:04 +01:00
|
|
|
<ListItemIcon><PermissionWrite/></ListItemIcon>
|
2023-01-05 02:34:22 +01:00
|
|
|
<ListItemText primary={t("prefs_reservations_table_everyone_write_only")}/>
|
|
|
|
</MenuItem>
|
|
|
|
<MenuItem value="read-write">
|
2023-01-24 02:04:04 +01:00
|
|
|
<ListItemIcon><PermissionReadWrite/></ListItemIcon>
|
2023-01-05 02:34:22 +01:00
|
|
|
<ListItemText primary={t("prefs_reservations_table_everyone_read_write")}/>
|
|
|
|
</MenuItem>
|
|
|
|
</Select>
|
|
|
|
</FormControl>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ReserveTopicSelect;
|