import React, { useState } from 'react' import { IDict } from '../common' import * as helpers from '../helpers' export interface ISchemaFieldProps { column: IDict metadata: IDict removeField: any updateField: any } export function SchemaField(props: ISchemaFieldProps) { const types = helpers.getFieldTypes() const formats = helpers.getFieldFormats(props.column.field.type) const [isDetails, setIsDetails] = useState(false) return (
{/* General */}
{/* Name */}
Name
props.updateField(props.column.id, 'name', ev.target.value)} />
{/* Type */}
Type
{/* Format */}
Format
{ props.updateField(props.column.id, 'format', ev.target.value) }} />
{/* Controls */}
{/* Details */} {/* Remove */}
{/* Details */} {isDetails && (
{/* Extra fields */}
{/* Title */}
props.updateField(props.column.id, 'title', ev.target.value) } />
{/* Description */}