divider.tsx 530 B

1234567891011121314151617181920212223
  1. "use client";
  2. import { type ComponentRenderProps } from "@json-render/react";
  3. export function Divider({ element }: ComponentRenderProps) {
  4. const { orientation } = element.props as { orientation?: string | null };
  5. if (orientation === "vertical") {
  6. return (
  7. <div
  8. style={{ width: 1, background: "var(--border)", alignSelf: "stretch" }}
  9. />
  10. );
  11. }
  12. return (
  13. <hr
  14. style={{
  15. border: "none",
  16. borderTop: "1px solid var(--border)",
  17. margin: "16px 0",
  18. }}
  19. />
  20. );
  21. }