Files
Open-Assistant/website/src/components/Survey/TwoColumnsWithCards.tsx
T
2023-01-11 22:12:09 -06:00

20 lines
525 B
TypeScript

import { Box, Stack } from "@chakra-ui/react";
import { SurveyCard } from "src/components/Survey/SurveyCard";
export const TwoColumnsWithCards = ({ children }: { children: React.ReactNode[] }) => {
if (!Array.isArray(children) || children.length !== 2) {
throw new Error("TwoColumns expects 2 children");
}
const [first, second] = children;
return (
<Box mb="4">
<Stack spacing="4">
<SurveyCard>{first}</SurveyCard>
<SurveyCard>{second}</SurveyCard>
</Stack>
</Box>
);
};