2024-04-04 13:48:45 +00:00
|
|
|
|
import { Box, Typography, useTheme } from "@mui/material";
|
|
|
|
|
|
import { FC } from "react";
|
2024-04-30 12:23:58 +00:00
|
|
|
|
import { ServiceButton } from "./ServiceButton/ServiceButton";
|
|
|
|
|
|
import { YandexMetricaLogo } from "../mocks/YandexMetricaLogo";
|
|
|
|
|
|
import ServiceModal from "./ServiceModal/ServiceModal";
|
|
|
|
|
|
import { VKPixelLogo } from "../mocks/VKPixelLogo";
|
2024-04-04 13:48:45 +00:00
|
|
|
|
|
|
|
|
|
|
export type Partner = {
|
|
|
|
|
|
name: string;
|
|
|
|
|
|
logo?: string;
|
|
|
|
|
|
category: string;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
type PartnersBoardProps = {
|
|
|
|
|
|
partners: Partner[];
|
|
|
|
|
|
setIsModalOpen: (value: boolean) => void;
|
2024-04-30 12:23:58 +00:00
|
|
|
|
companyName: string;
|
2024-04-05 10:48:10 +00:00
|
|
|
|
setCompanyName: (value: string) => void;
|
2024-04-18 01:32:39 +00:00
|
|
|
|
isModalOpen: boolean;
|
2024-04-18 12:32:46 +00:00
|
|
|
|
handleCloseModal: () => void;
|
2024-04-04 13:48:45 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export const PartnersBoard: FC<PartnersBoardProps> = ({
|
|
|
|
|
|
partners,
|
|
|
|
|
|
setIsModalOpen,
|
2024-04-18 01:32:39 +00:00
|
|
|
|
isModalOpen,
|
|
|
|
|
|
handleCloseModal,
|
2024-04-30 12:23:58 +00:00
|
|
|
|
companyName,
|
2024-04-05 10:48:10 +00:00
|
|
|
|
setCompanyName,
|
2024-04-04 13:48:45 +00:00
|
|
|
|
}) => {
|
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
2024-04-30 12:23:58 +00:00
|
|
|
|
// const partnersByCategory = partners.reduce(
|
|
|
|
|
|
// (acc, partner) => {
|
|
|
|
|
|
// (acc[partner.category] = acc[partner.category] || []).push(partner);
|
|
|
|
|
|
// return acc;
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {} as Record<string, Partner[]>,
|
|
|
|
|
|
// );
|
2024-04-04 13:48:45 +00:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Box
|
|
|
|
|
|
sx={{
|
|
|
|
|
|
width: "100%",
|
|
|
|
|
|
display: "flex",
|
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
|
justifyContent: { xs: "center", sm: "center", md: "start" },
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
2024-04-18 01:32:39 +00:00
|
|
|
|
{/*{Object.entries(partnersByCategory).map(([category, partners]) => (*/}
|
|
|
|
|
|
{/* <Box key={category}>*/}
|
|
|
|
|
|
{/* <Typography*/}
|
|
|
|
|
|
{/* variant="h6"*/}
|
|
|
|
|
|
{/* sx={{*/}
|
|
|
|
|
|
{/* textAlign: { xs: "center", sm: "start", md: "start" },*/}
|
|
|
|
|
|
{/* lineHeight: "1",*/}
|
|
|
|
|
|
{/* marginBottom: "12px",*/}
|
|
|
|
|
|
{/* }}*/}
|
|
|
|
|
|
{/* >*/}
|
|
|
|
|
|
{/* {category}*/}
|
|
|
|
|
|
{/* </Typography>*/}
|
|
|
|
|
|
{/* <Box*/}
|
|
|
|
|
|
{/* sx={{*/}
|
|
|
|
|
|
{/* display: "flex",*/}
|
|
|
|
|
|
{/* flexWrap: "wrap",*/}
|
|
|
|
|
|
{/* justifyContent: { xs: "center", sm: "start", md: "start" },*/}
|
|
|
|
|
|
{/* }}*/}
|
|
|
|
|
|
{/* >*/}
|
|
|
|
|
|
{/* {partners.map((partner) => (*/}
|
|
|
|
|
|
{/* <PartnerItem*/}
|
|
|
|
|
|
{/* key={partner.name}*/}
|
|
|
|
|
|
{/* partner={partner}*/}
|
|
|
|
|
|
{/* setIsModalOpen={setIsModalOpen}*/}
|
|
|
|
|
|
{/* setCompanyName={setCompanyName}*/}
|
|
|
|
|
|
{/* />*/}
|
|
|
|
|
|
{/* ))}*/}
|
|
|
|
|
|
|
|
|
|
|
|
{/* </Box>*/}
|
|
|
|
|
|
{/* </Box>*/}
|
|
|
|
|
|
{/*))}*/}
|
2024-04-30 12:23:58 +00:00
|
|
|
|
|
|
|
|
|
|
<Box>
|
|
|
|
|
|
<Typography
|
|
|
|
|
|
variant="h6"
|
|
|
|
|
|
sx={{
|
|
|
|
|
|
textAlign: { xs: "start", sm: "start", md: "start" },
|
|
|
|
|
|
lineHeight: "1",
|
|
|
|
|
|
marginBottom: "12px",
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
Аналитика
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
<Box
|
|
|
|
|
|
sx={{
|
|
|
|
|
|
display: "flex",
|
|
|
|
|
|
flexWrap: "wrap",
|
|
|
|
|
|
justifyContent: { xs: "start", sm: "start", md: "start" },
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
<ServiceButton
|
|
|
|
|
|
logo={<YandexMetricaLogo />}
|
|
|
|
|
|
setIsModalOpen={setIsModalOpen}
|
|
|
|
|
|
name={"yandex"}
|
|
|
|
|
|
setCompanyName={setCompanyName}
|
|
|
|
|
|
/>
|
|
|
|
|
|
<ServiceButton
|
|
|
|
|
|
logo={<VKPixelLogo />}
|
|
|
|
|
|
title={"VK Пиксель"}
|
|
|
|
|
|
name={"vk"}
|
|
|
|
|
|
setIsModalOpen={setIsModalOpen}
|
|
|
|
|
|
setCompanyName={setCompanyName}
|
|
|
|
|
|
></ServiceButton>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
<ServiceModal
|
2024-04-18 12:32:46 +00:00
|
|
|
|
isModalOpen={isModalOpen}
|
|
|
|
|
|
handleCloseModal={handleCloseModal}
|
2024-04-30 12:23:58 +00:00
|
|
|
|
companyName={companyName}
|
2024-04-18 12:32:46 +00:00
|
|
|
|
/>
|
2024-04-04 13:48:45 +00:00
|
|
|
|
</Box>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|