| 1 | "use client"; |
| 2 | |
| 3 | import { PlateElement, type PlateElementProps } from "platejs/react"; |
| 4 | |
| 5 | import { cn } from "@/lib/utils"; |
| 6 | |
| 7 | export default function ProsConsGroup(props: PlateElementProps) { |
| 8 | const { alignment = "center" } = props.element; |
| 9 | |
| 10 | return ( |
| 11 | <PlateElement {...props}> |
| 12 | <div |
| 13 | className={cn( |
| 14 | "mb-4 grid items-stretch gap-6 md:grid-cols-2", |
| 15 | // Only apply horizontal alignment, don't break the grid layout |
| 16 | alignment === "left" && "justify-start", |
| 17 | alignment === "right" && "justify-end", |
| 18 | alignment === "center" && "justify-center", |
| 19 | )} |
| 20 | > |
| 21 | {props.children} |
| 22 | </div> |
| 23 | </PlateElement> |
| 24 | ); |
| 25 | } |
| 26 |