frontPanel/src/pages/IntegrationsPage/IntegrationsModal/SettingsBlock/AmoSettingsBlock.tsx

82 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-04-10 15:49:04 +00:00
import { FC } from "react";
import { Box, useMediaQuery, useTheme } from "@mui/material";
import { StepButtonsBlock } from "../StepButtonsBlock/StepButtonsBlock";
2024-04-12 09:05:33 +00:00
import { SettingItem } from "./SettingItem/SettingItem";
2024-05-17 12:04:59 +00:00
import { TQuestionEntity, TTags } from "../AmoCRMModal";
2024-04-10 15:49:04 +00:00
2024-05-24 21:23:55 +00:00
type AmoSettingsBlockProps = {
2024-04-12 09:05:33 +00:00
stepTitles: string[];
2024-04-10 15:49:04 +00:00
setStep: (value: number) => void;
setIsSettingsBlock: (value: boolean) => void;
selectedFunnel: number | null;
selectedStage: number | null;
2024-04-10 15:49:04 +00:00
selectedDealPerformer: string | null;
2024-04-16 10:57:38 +00:00
questionEntity: TQuestionEntity;
tags: TTags;
2024-04-10 15:49:04 +00:00
};
2024-05-24 21:23:55 +00:00
export const AmoSettingsBlock: FC<AmoSettingsBlockProps> = ({
2024-04-12 09:05:33 +00:00
stepTitles,
2024-04-10 15:49:04 +00:00
setStep,
setIsSettingsBlock,
selectedFunnel,
selectedDealPerformer,
selectedStage,
2024-04-16 10:57:38 +00:00
questionEntity,
tags,
2024-04-10 15:49:04 +00:00
}) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(600));
return (
<Box
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
height: "100%",
flexGrow: 1,
}}
>
<Box
sx={{
marginTop: "10px",
width: "100%",
2024-04-12 09:05:33 +00:00
height: "443px",
2024-04-10 15:49:04 +00:00
borderRadius: "10px",
2024-04-12 09:05:33 +00:00
padding: " 0 20px",
2024-04-10 15:49:04 +00:00
boxShadow: "0 0 20px rgba(0, 0, 0, 0.15)",
2024-04-12 09:05:33 +00:00
overflowY: "auto",
flexGrow: 1,
2024-04-10 15:49:04 +00:00
}}
2024-04-12 09:05:33 +00:00
>
{stepTitles &&
stepTitles.map((title, index) => (
<SettingItem
step={index}
title={title}
setIsSettingsBlock={setIsSettingsBlock}
setStep={setStep}
selectedDealPerformer={selectedDealPerformer}
selectedFunnel={selectedFunnel}
2024-04-12 09:05:33 +00:00
selectedStage={selectedStage}
2024-04-16 10:57:38 +00:00
questionEntity={questionEntity}
tags={tags}
2024-04-12 09:05:33 +00:00
/>
))}
</Box>
2024-04-10 15:49:04 +00:00
<Box
sx={{
marginTop: "20px",
alignSelf: "end",
}}
>
<StepButtonsBlock
onSmallBtnClick={() => setIsSettingsBlock(false)}
isLargeBtnMissing={true}
/>
</Box>
</Box>
);
};