go-ethereum/src/components/UI/downloads/DownloadsSection.tsx
2022-10-25 19:10:19 -05:00

36 lines
939 B
TypeScript

import { Box, Image, Stack } from '@chakra-ui/react';
import { FC } from 'react';
interface Props {
children: React.ReactNode;
id: string;
imgSrc?: string;
imgAltText?: string;
sectionTitle: string;
}
export const DownloadsSection: FC<Props> = ({ children, imgSrc, imgAltText, sectionTitle, id }) => {
return (
<Stack border='2px solid' borderColor='brand.light.primary' id={id}>
{!!imgSrc && (
<Stack alignItems='center' p={4} borderBottom='2px solid' borderColor='brand.light.primary'>
{/* TODO: use NextImage */}
<Image src={imgSrc} alt={imgAltText} />
</Stack>
)}
<Stack
p={4}
borderBottom='2px solid'
borderColor='brand.light.primary'
sx={{ mt: '0 !important' }}
>
<Box as='h2' textStyle='h2'>
{sectionTitle}
</Box>
</Stack>
<Stack spacing={4}>{children}</Stack>
</Stack>
);
};