front-hub/src/pages/Support/Support.tsx

67 lines
2.4 KiB
TypeScript
Raw Normal View History

2022-12-15 14:09:07 +00:00
import { Typography, Box, useTheme, useMediaQuery, IconButton, List, ListItem } from "@mui/material";
2022-11-23 11:46:04 +00:00
import SectionWrapper from "../../components/SectionWrapper";
2022-11-25 18:52:46 +00:00
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
2022-12-04 12:41:10 +00:00
import ComplexNavText from "../../components/ComplexNavText";
2022-12-15 14:09:07 +00:00
import SupportChat from "./SupportChat";
import CreateTicket from "./CreateTicket";
import TicketCard from "./TicketCard";
import { useParams } from "react-router-dom";
2022-11-23 11:46:04 +00:00
export default function Support() {
const theme = useTheme();
2022-11-25 18:52:46 +00:00
const upMd = useMediaQuery(theme.breakpoints.up("md"));
2022-12-15 14:09:07 +00:00
const ticketId = useParams().ticketId;
2022-11-23 11:46:04 +00:00
return (
<SectionWrapper
maxWidth="lg"
sx={{
2022-11-25 18:52:46 +00:00
pt: upMd ? "25px" : "20px",
pb: upMd ? "70px" : "18px",
height: "100%",
display: "flex",
flexDirection: "column",
}}
outerContainerSx={{
height: upMd ? undefined : "calc(100vh - 51px)",
2022-11-23 11:46:04 +00:00
}}
>
2022-11-25 18:52:46 +00:00
{upMd &&
2022-12-15 14:09:07 +00:00
<ComplexNavText text1="Все тарифы — " text2="Запрос в службу техподдержки" />
2022-11-25 18:52:46 +00:00
}
2022-11-23 11:46:04 +00:00
<Box
sx={{
2022-12-04 12:41:10 +00:00
mt: "20px",
2022-11-25 18:52:46 +00:00
mb: "40px",
2022-11-23 11:46:04 +00:00
display: "flex",
2022-11-25 18:52:46 +00:00
gap: "10px",
}}
>
{!upMd &&
<IconButton sx={{ p: 0, height: "28px", width: "28px", color: "black" }}>
<ArrowBackIcon />
</IconButton>
}
<Typography variant="h4">Запрос в службу техподдержки</Typography>
</Box>
2022-12-15 14:09:07 +00:00
{ticketId ?
<SupportChat />
:
<>
<CreateTicket />
<List sx={{ mt: "40px" }}>
<ListItem sx={{ px: 0 }}>
<TicketCard
name="Название тикета"
body="Содержание тикета"
time="15.09.22 08:39"
ticketId="someTicketId"
2022-11-23 11:46:04 +00:00
/>
2022-12-15 14:09:07 +00:00
</ListItem>
</List>
</>
}
2022-11-25 18:52:46 +00:00
</SectionWrapper >
2022-11-23 11:46:04 +00:00
);
}