frontend/containers/DrawerPassenger/DrawerPassengerHeader.tsx (view raw)
1import {Box, IconButton, Icon, Typography} from '@mui/material';
2import {t} from 'i18next';
3
4interface DrawerHeaderProps {
5 isMobile: boolean;
6 onClose: () => void;
7}
8
9const DrawerHeader = ({isMobile, onClose}: DrawerHeaderProps) => {
10 return (
11 <Box>
12 {!isMobile && (
13 <Box
14 display="flex"
15 justifyContent="flex-end"
16 alignItems="flex-end"
17 paddingTop={2}
18 >
19 <IconButton
20 sx={{marginRight: 0}}
21 color="inherit"
22 edge="end"
23 aria-label="close"
24 onClick={onClose}
25 id="CloseBtn"
26 >
27 <Icon>close</Icon>
28 </IconButton>
29 </Box>
30 )}
31 <Box
32 display="flex"
33 alignItems="center"
34 justifyContent="space-between"
35 paddingBottom={2}
36 >
37 <Box display="flex" alignItems="center">
38 {isMobile && (
39 <IconButton
40 sx={{marginRight: 0}}
41 color="inherit"
42 edge="end"
43 aria-label="close"
44 onClick={onClose}
45 id="CloseBtn"
46 >
47 <Icon>chevron_left</Icon>
48 </IconButton>
49 )}
50 <Typography
51 variant="h3"
52 pl={2}
53 >{t`passenger.informations.title`}</Typography>
54 </Box>
55 </Box>
56 </Box>
57 );
58};
59
60export default DrawerHeader;