2024-08-05 16:07:25 +00:00
|
|
|
|
import { FC } from "react";
|
2024-08-11 02:03:46 +00:00
|
|
|
|
import { Box, Typography, useMediaQuery, useTheme } from "@mui/material";
|
2024-08-05 16:07:25 +00:00
|
|
|
|
import { StepButtonsBlock } from "../StepButtonsBlock";
|
|
|
|
|
import { SettingItem } from "./SettingItem/SettingItem";
|
|
|
|
|
import { SelectedQuestions, SelectedTags } from "../types";
|
|
|
|
|
|
|
|
|
|
type AmoSettingsBlockProps = {
|
|
|
|
|
stepTitles: string[];
|
|
|
|
|
selectedFunnel: string | null;
|
|
|
|
|
selectedStage: string | null;
|
|
|
|
|
selectedDealUser: string | null;
|
|
|
|
|
selectedQuestions: SelectedQuestions;
|
|
|
|
|
selectedTags: SelectedTags;
|
2024-08-11 02:03:46 +00:00
|
|
|
|
toBack: () => void
|
|
|
|
|
setStep: (step: number) => void
|
2024-08-05 16:07:25 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const SettingsBlock: FC<AmoSettingsBlockProps> = ({
|
|
|
|
|
stepTitles,
|
|
|
|
|
selectedFunnel,
|
|
|
|
|
selectedDealUser,
|
|
|
|
|
selectedStage,
|
|
|
|
|
selectedQuestions,
|
|
|
|
|
selectedTags,
|
2024-08-11 02:03:46 +00:00
|
|
|
|
toBack,
|
|
|
|
|
setStep,
|
2024-08-05 16:07:25 +00:00
|
|
|
|
}) => {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
|
|
|
|
|
|
|
|
|
return (
|
2024-08-11 02:03:46 +00:00
|
|
|
|
<Box sx={{ flexGrow: 1, width: "100%", height: "100%"}}>
|
2024-08-05 16:07:25 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
height: "100%",
|
|
|
|
|
flexGrow: 1,
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-08-11 02:03:46 +00:00
|
|
|
|
<Typography
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: "24px",
|
|
|
|
|
fontWeight: 500,
|
|
|
|
|
lineHeight: "28.44px"
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Мои настройки
|
|
|
|
|
</Typography>
|
2024-08-05 16:07:25 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
2024-08-11 02:03:46 +00:00
|
|
|
|
marginTop: "20px",
|
2024-08-05 16:07:25 +00:00
|
|
|
|
width: "100%",
|
2024-08-11 02:03:46 +00:00
|
|
|
|
minHheight: "440px",
|
|
|
|
|
maxHeight: "90%",
|
2024-08-05 16:07:25 +00:00
|
|
|
|
borderRadius: "10px",
|
|
|
|
|
padding: " 0 20px",
|
|
|
|
|
boxShadow: "0 0 20px rgba(0, 0, 0, 0.15)",
|
|
|
|
|
overflowY: "auto",
|
|
|
|
|
flexGrow: 1,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{stepTitles &&
|
|
|
|
|
stepTitles.map((title, index) => (
|
|
|
|
|
<SettingItem
|
2024-08-11 02:03:46 +00:00
|
|
|
|
step={index+1}
|
2024-08-05 16:07:25 +00:00
|
|
|
|
title={title}
|
|
|
|
|
selectedDealUser={selectedDealUser}
|
|
|
|
|
selectedFunnel={selectedFunnel}
|
|
|
|
|
selectedStage={selectedStage}
|
|
|
|
|
selectedQuestions={selectedQuestions}
|
|
|
|
|
selectedTags={selectedTags}
|
2024-08-11 02:03:46 +00:00
|
|
|
|
|
|
|
|
|
setStep={setStep}
|
2024-08-05 16:07:25 +00:00
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
alignSelf: "end",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<StepButtonsBlock
|
2024-08-11 02:03:46 +00:00
|
|
|
|
onSmallBtnClick={toBack}
|
2024-08-05 16:07:25 +00:00
|
|
|
|
isLargeBtnMissing={true}
|
|
|
|
|
/>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|