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

91 lines
2.4 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-04-16 10:57:38 +00:00
import { TQuestionEntity, TTags } from "../IntegrationsModal";
2024-04-10 15:49:04 +00:00
type SettingsBlockProps = {
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;
selectedFunnelPerformer: string | null;
selectedFunnel: string | null;
selectedStagePerformer: string | null;
selectedStage: string | null;
selectedDealPerformer: string | null;
utmFile: File | null;
2024-04-16 10:57:38 +00:00
questionEntity: TQuestionEntity;
tags: TTags;
2024-04-10 15:49:04 +00:00
};
export const SettingsBlock: FC<SettingsBlockProps> = ({
2024-04-12 09:05:33 +00:00
stepTitles,
2024-04-10 15:49:04 +00:00
setStep,
setIsSettingsBlock,
selectedFunnelPerformer,
selectedFunnel,
selectedStagePerformer,
selectedDealPerformer,
selectedStage,
utmFile,
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}
selectedFunnelPerformer={selectedFunnelPerformer}
selectedFunnel={selectedFunnel}
selectedStagePerformer={selectedStagePerformer}
selectedDealPerformer={selectedDealPerformer}
selectedStage={selectedStage}
utmFile={utmFile}
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>
);
};