import React from 'react';
import { JsonView } from '@wix/patterns-fields';
import type { CellViewProps } from '../../types';
import { CellViewLayout } from '../CellViewLayout';

export const ObjectView: React.FC<CellViewProps<Record<string, unknown>>> = ({
  value,
}) => (
  <CellViewLayout>
    {value != null ? <JsonView data={value} /> : null}
  </CellViewLayout>
);
