2024-05-07 12:47:06 +05:30
|
|
|
import { ArrowForwardIcon } from "@chakra-ui/icons";
|
|
|
|
|
import { Box, Button, HStack, Skeleton, Text } from "@chakra-ui/react";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import CommunityBannerCard from "../Pages/Community/CommunityBannerCard";
|
|
|
|
|
|
|
|
|
|
const BannerStack = ({
|
|
|
|
|
stackTitle,
|
|
|
|
|
viewAllLink,
|
|
|
|
|
bannerIsLoading,
|
|
|
|
|
bannerArray,
|
|
|
|
|
viewBannerLink,
|
|
|
|
|
}) => {
|
2024-05-08 17:33:10 +05:30
|
|
|
|
|
|
|
|
|
2024-05-07 12:47:06 +05:30
|
|
|
return (
|
2024-05-08 12:53:53 +05:30
|
|
|
<Box >
|
2024-05-07 12:47:06 +05:30
|
|
|
<HStack
|
|
|
|
|
display={"flex"}
|
|
|
|
|
justifyContent={"space-between"}
|
|
|
|
|
alignItems={"center"}
|
|
|
|
|
pe={1}
|
|
|
|
|
>
|
|
|
|
|
<Text as={"span"} color={"teal.800"} className="web-text-large fw-bold">
|
|
|
|
|
{stackTitle}
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
|
|
<Link to={viewAllLink}>
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
rightIcon={<ArrowForwardIcon />}
|
|
|
|
|
colorScheme={"teal"}
|
|
|
|
|
size="sm"
|
|
|
|
|
>
|
|
|
|
|
View all
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</HStack>
|
|
|
|
|
|
|
|
|
|
<Box
|
|
|
|
|
display={"flex"}
|
|
|
|
|
// bg={"red.500"}
|
|
|
|
|
alignItems={"start"}
|
|
|
|
|
flexWrap={"wrap"}
|
|
|
|
|
justifyContent={"start"}
|
|
|
|
|
w={"100%"}
|
|
|
|
|
// h={"auto"}
|
|
|
|
|
h={200}
|
2024-05-08 12:53:53 +05:30
|
|
|
ps={1}
|
2024-05-07 12:47:06 +05:30
|
|
|
>
|
|
|
|
|
{bannerIsLoading
|
|
|
|
|
? Array.from({ length: 4 }).map((_, index) => (
|
|
|
|
|
<Box className="col-4 p-2 ps-0">
|
|
|
|
|
<Skeleton w={"100%"} key={index} rounded={"md"} height={150} />
|
|
|
|
|
</Box>
|
|
|
|
|
))
|
|
|
|
|
: bannerArray?.map(
|
|
|
|
|
({
|
|
|
|
|
id,
|
|
|
|
|
CTO_button_title,
|
|
|
|
|
banner_image,
|
|
|
|
|
Heading,
|
|
|
|
|
createdAt,
|
|
|
|
|
sub_heading,
|
2024-05-08 17:33:10 +05:30
|
|
|
status
|
2024-05-07 12:47:06 +05:30
|
|
|
}) => (
|
|
|
|
|
<Link className="col-4 h-100 p-3 ps-0" key={id} to={`${viewBannerLink}/${id}`}>
|
|
|
|
|
<CommunityBannerCard
|
2024-05-08 17:33:10 +05:30
|
|
|
status={status}
|
2024-05-07 12:47:06 +05:30
|
|
|
bgImage={banner_image}
|
|
|
|
|
subHeading={sub_heading}
|
|
|
|
|
heading={Heading}
|
|
|
|
|
createdAt={createdAt}
|
|
|
|
|
ctoBtnTitle={CTO_button_title}
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
)
|
|
|
|
|
)}
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default BannerStack;
|