import { Col, Form, Row, Tag } from 'antd'; import React from 'react'; import { TypeInput } from './types/TypeInput'; type ProperyRenderProps = { initialValue: unknown; property: Realm.CanonicalObjectSchemaProperty; isPrimary: boolean; set: (value: unknown) => void; }; export const typeToString = (property: Realm.CanonicalObjectSchemaProperty): string => { let title = ''; switch (property.type) { case 'list': case 'set': case 'dictionary': case 'object': title += property.objectType; break; default: title += property.type; } if (property.optional) { title += '?'; } switch (property.type) { case 'list': title += '[]'; break; case 'set': title += '<>'; break; case 'dictionary': title += '{}'; break; } return title; }; export const PropertyRender = ({ initialValue, property, isPrimary, set, }: ProperyRenderProps) => { const title = typeToString(property); return ( <> {property.name} {/* */} {title} {!property.optional ? required : null} {isPrimary ? primary key : null} {/* */}
// ); };