This repository has been archived on 2022-05-20. You can view files and clone it, but cannot push or open issues or pull requests.
Alley-HSBC-Frontend/src/components/home/CallFavouritesDialog.tsx

44 lines
1.4 KiB
TypeScript

import { Button, Checkbox, Dialog, DialogActions, DialogContent, DialogTitle, FormControlLabel, FormGroup, Typography } from "@mui/material";
import { SidebarUserObj } from "../sidebar/SidebarUser";
interface Props {
open: boolean;
selectedValue: SidebarUserObj;
onClose: (value: SidebarUserObj) => void;
users: SidebarUserObj[];
}
const CallFavouritesDialog: React.FC<Props> = ({ open, selectedValue, onClose, users }: Props) => {
const handleClose = () => {
onClose(selectedValue);
};
return (
<Dialog
onClose={handleClose}
open={open}
fullWidth
maxWidth="sm"
>
<DialogTitle>Select who to call:</DialogTitle>
<DialogContent>
<FormControlLabel control={<Checkbox color="success" />} label="Select everyone" />
</DialogContent>
<DialogContent sx={{ height: "40vh" }} dividers>
<FormGroup>
{users.map((user) => (
<FormControlLabel key={user.id} control={<Checkbox color="success" />} label={user.name} />
))}
</FormGroup>
</DialogContent>
<DialogActions>
<Button color="success" onClick={handleClose}>
<Typography variant="button" color="black">Call</Typography>
</Button>
</DialogActions>
</Dialog>
);
};
export default CallFavouritesDialog;