Projekt

Obecné

Profil

Stáhnout (3.89 KB) Statistiky
| Větev: | Tag: | Revize:
1
import {
2
    Box,
3
    Button,
4
    Collapse,
5
    Container,
6
    Grid,
7
    Paper,
8
    Stack,
9
    TextField,
10
    Typography,
11
} from '@mui/material'
12
import CatalogTable from './CatalogTable'
13
import { Fragment, useState } from 'react'
14

    
15
const Catalog = () => {
16
    const [filterOpen, setFilterOpen] = useState(false)
17
    const toggleFilter = () => {
18
        setFilterOpen(!filterOpen)
19
    }
20

    
21
    return (
22
        <Fragment>
23
            <Paper
24
                sx={{ py: 2, mt: 2 }}
25
                variant="outlined"
26
                style={{ minHeight: '50vh' }}
27
            >
28
                <Container sx={{ mt: 4 }}>
29
                    <Typography variant="h3" sx={{mb: 2}} fontWeight="bold" >Catalog</Typography>
30
                    <Button variant="outlined" color="primary" onClick={toggleFilter}>
31
                        Filter
32
                    </Button>
33
                    <Collapse in={filterOpen} timeout="auto" unmountOnExit>
34
                        <Grid container spacing={1} alignItems="stretch">
35
                            <Grid item xs={6}>
36
                                <Stack
37
                                    direction="column"
38
                                    spacing={1}
39
                                    sx={{ mt: 2 }}
40
                                >
41
                                    <Stack direction="row" spacing={2}>
42
                                        <TextField
43
                                            size="small"
44
                                            id="name"
45
                                            label="Name"
46
                                        />
47
                                        <TextField
48
                                            size="small"
49
                                            id="type"
50
                                            label="Type"
51
                                        />
52
                                        <TextField
53
                                            size="small"
54
                                            id="coordinates"
55
                                            label="Coordinates"
56
                                        />
57
                                    </Stack>
58
                                    <Stack direction="row" spacing={2}>
59
                                        <TextField
60
                                            size="small"
61
                                            id="writtenForm"
62
                                            label="Written form"
63
                                        />
64
                                        <TextField
65
                                            size="small"
66
                                            id="stateOrTerritory"
67
                                            label="State or territory"
68
                                        />
69
                                        <TextField
70
                                            size="small"
71
                                            id="groupBy"
72
                                            label="Group by"
73
                                        />
74
                                    </Stack>
75
                                </Stack>
76
                            </Grid>
77
                            <Grid item xs sx={{ mt: 'auto', ml: 1, mb: 1 }}>
78
                                <Stack
79
                                    direction="row"
80
                                    justifyContent="flex-start"
81
                                    alignItems="flex-end"
82
                                >
83
                                    <Button variant="outlined">Search</Button>
84
                                </Stack>
85
                            </Grid>
86
                        </Grid>
87
                    </Collapse>
88

    
89
                    <Box sx={{ mt: 4 }}>
90
                        <CatalogTable />
91
                    </Box>
92
                </Container>
93
            </Paper>
94
        </Fragment>
95
    )
96
}
97

    
98
export default Catalog
(1-1/3)