Wrap totals in collapsible

This commit is contained in:
Calli
2024-04-28 10:08:55 +03:00
parent 0a0f41cc25
commit 8190351e51

View File

@@ -15,8 +15,12 @@ import {
useTheme, useTheme,
Stack, Stack,
styled, styled,
Accordion,
AccordionSummary,
AccordionDetails,
} from "@mui/material"; } from "@mui/material";
import { useContext } from "react"; import { useContext } from "react";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
const StackItem = styled(Stack)(({ theme }) => ({ const StackItem = styled(Stack)(({ theme }) => ({
...theme.typography.body2, ...theme.typography.body2,
@@ -75,7 +79,11 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
return ( return (
<StackItem width="100%"> <StackItem width="100%">
<Accordion style={{ width: "100%" }}>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<h2>Totals</h2> <h2>Totals</h2>
</AccordionSummary>
<AccordionDetails>
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table size="small" aria-label="a dense table"> <Table size="small" aria-label="a dense table">
<TableHead> <TableHead>
@@ -89,7 +97,9 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
</TableCell> </TableCell>
<TableCell width="10%"> <TableCell width="10%">
<Tooltip title="How many units per hour factories are producing"> <Tooltip title="How many units per hour factories are producing">
<Typography fontSize={theme.custom.smallText}>u/h</Typography> <Typography fontSize={theme.custom.smallText}>
u/h
</Typography>
</Tooltip> </Tooltip>
</TableCell> </TableCell>
<TableCell width="10%" align="right"> <TableCell width="10%" align="right">
@@ -120,6 +130,8 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>
</AccordionDetails>
</Accordion>
</StackItem> </StackItem>
); );
}; };