divider.tsx 451 B

1234567891011
  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 <div style={{ width: 1, background: 'var(--border)', alignSelf: 'stretch' }} />;
  7. }
  8. return <hr style={{ border: 'none', borderTop: '1px solid var(--border)', margin: '16px 0' }} />;
  9. }