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

59 lines
1.9 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-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 { useParams } from "react-router-dom";
2022-12-22 12:43:14 +00:00
import TicketList from "./TicketList";
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",
2022-12-18 19:57:33 +00:00
pb: upMd ? "82px" : "43px",
2022-11-25 18:52:46 +00:00
height: "100%",
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 />
:
2022-12-22 12:43:14 +00:00
<Box
sx={{
2022-12-18 19:57:33 +00:00
display: "flex",
flexDirection: "column",
2022-12-22 12:43:14 +00:00
gap: upMd ? "40px" : "60px",
}}
>
<CreateTicket />
<TicketList />
</Box>
2022-12-15 14:09:07 +00:00
}
2022-12-18 19:57:33 +00:00
</SectionWrapper>
2022-11-23 11:46:04 +00:00
);
}