| 1 | import { SlateElement, type SlateElementProps } from "platejs/static"; |
| 2 | |
| 3 | import { cn } from "@/lib/utils"; |
| 4 | |
| 5 | export default function StaircaseStatic(props: SlateElementProps) { |
| 6 | const { alignment = "center" } = props.element as { |
| 7 | alignment?: "left" | "center" | "right"; |
| 8 | }; |
| 9 | |
| 10 | return ( |
| 11 | <SlateElement {...props}> |
| 12 | {/* Container for alignment control */} |
| 13 | <div |
| 14 | className={cn( |
| 15 | "my-0 flex w-full", |
| 16 | // Apply alignment to the container, not the staircase structure |
| 17 | alignment === "left" && "justify-start", |
| 18 | alignment === "right" && "justify-end", |
| 19 | alignment === "center" && "justify-center", |
| 20 | )} |
| 21 | > |
| 22 | {/* Staircase structure - always full width, vertical flow */} |
| 23 | <div className="flex w-full flex-col gap-2">{props.children}</div> |
| 24 | </div> |
| 25 | </SlateElement> |
| 26 | ); |
| 27 | } |
| 28 |