返回 presentation-ai
pros-cons-static.tsx
根目录 / src / components / notebook / presentation / editor / custom-elements / static / pros-cons-static.tsx
1 import { SlateElement, type SlateElementProps } from "platejs/static";
2
3 import { cn } from "@/lib/utils";
4
5 export default function ProsConsGroupStatic(props: SlateElementProps) {
6 const { alignment = "center" } = props.element as {
7 alignment?: "left" | "center" | "right";
8 };
9
10 return (
11 <SlateElement {...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 </SlateElement>
24 );
25 }
26
26 lines Plain Text