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

59 lines
1.6 KiB
TypeScript
Raw Normal View History

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