2024-04-08 14:05:38 +00:00
|
|
|
import { Box, useMediaQuery, useTheme } from "@mui/material";
|
2024-04-09 13:07:42 +00:00
|
|
|
import { FC } from "react";
|
2024-04-05 10:48:10 +00:00
|
|
|
import { StepButtonsBlock } from "../StepButtonsBlock/StepButtonsBlock";
|
2024-04-08 14:05:38 +00:00
|
|
|
import { CustomSelect } from "../../../../components/CustomSelect/CustomSelect";
|
2024-04-09 13:07:42 +00:00
|
|
|
import { CustomRadioGroup } from "../../../../components/CustomRadioGroup/CustomRadioGroup";
|
2024-06-16 10:48:49 +00:00
|
|
|
import { MinifiedData } from "../types";
|
2024-04-05 10:48:10 +00:00
|
|
|
|
2024-06-14 02:30:30 +00:00
|
|
|
type Props = {
|
2024-06-16 10:48:49 +00:00
|
|
|
pipelines: MinifiedData[];
|
|
|
|
|
users: MinifiedData[];
|
2024-04-05 10:48:10 +00:00
|
|
|
handlePrevStep: () => void;
|
|
|
|
|
handleNextStep: () => void;
|
2024-06-16 10:48:49 +00:00
|
|
|
selectedDealUser: string | null;
|
|
|
|
|
setSelectedDealPerformer: (value: string | null) => void;
|
2024-06-15 05:00:58 +00:00
|
|
|
selectedPipeline: string | null;
|
|
|
|
|
setSelectedPipeline: (value: string | null) => void;
|
2024-06-11 01:33:59 +00:00
|
|
|
|
2024-04-05 10:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
2024-06-14 02:30:30 +00:00
|
|
|
export const Pipelines: FC<Props> = ({
|
2024-06-16 10:48:49 +00:00
|
|
|
pipelines,
|
2024-05-21 21:29:33 +00:00
|
|
|
selectedPipeline,
|
|
|
|
|
setSelectedPipeline,
|
2024-06-16 10:48:49 +00:00
|
|
|
|
|
|
|
|
users,
|
|
|
|
|
selectedDealUser,
|
|
|
|
|
setSelectedDealPerformer,
|
|
|
|
|
|
|
|
|
|
handlePrevStep,
|
|
|
|
|
handleNextStep,
|
2024-04-05 10:48:10 +00:00
|
|
|
}) => {
|
|
|
|
|
const theme = useTheme();
|
2024-04-08 14:05:38 +00:00
|
|
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
|
|
|
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
2024-04-05 10:48:10 +00:00
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
height: "100%",
|
|
|
|
|
flexGrow: 1,
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-04-09 13:07:42 +00:00
|
|
|
<Box sx={{ width: "100%", marginTop: "20px", zIndex: 3 }}>
|
2024-04-08 14:05:38 +00:00
|
|
|
<CustomSelect
|
2024-06-16 10:48:49 +00:00
|
|
|
items={users}
|
|
|
|
|
selectedItemId={selectedDealUser}
|
|
|
|
|
setSelectedItem={setSelectedDealPerformer}
|
|
|
|
|
handleScroll={() => {}}
|
2024-04-09 13:07:42 +00:00
|
|
|
/>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
marginTop: "20px",
|
|
|
|
|
flexGrow: 1,
|
|
|
|
|
width: "100%",
|
|
|
|
|
height: "346px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<CustomRadioGroup
|
2024-06-16 10:48:49 +00:00
|
|
|
items={pipelines}
|
|
|
|
|
selectedItemId={selectedPipeline}
|
|
|
|
|
setSelectedItem={setSelectedPipeline}
|
|
|
|
|
handleScroll={() => {}}
|
2024-04-09 13:07:42 +00:00
|
|
|
/>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
marginTop: "20px",
|
|
|
|
|
alignSelf: "end",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<StepButtonsBlock
|
2024-04-10 09:38:30 +00:00
|
|
|
onLargeBtnClick={handleNextStep}
|
|
|
|
|
onSmallBtnClick={handlePrevStep}
|
2024-04-08 14:05:38 +00:00
|
|
|
/>
|
|
|
|
|
</Box>
|
2024-04-05 10:48:10 +00:00
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|