import { CollectionIcon, PlusIcon } from '@heroicons/react/outline'; import * as React from 'react'; import { VsLabel } from '../VscodeComponents'; import { DataBlockRecord } from '.'; import { SortableContainer, SortEnd } from 'react-sortable-hoc'; export interface IDataBlockRecordsProps { records: any[]; selectedIndex: number | null; onAdd: () => void; onSort: (obj: SortEnd) => void; onEdit: (id: number) => void; onDelete: (id: number) => void; } const Container = SortableContainer(({children}: React.PropsWithChildren) => { return ; }); export const DataBlockRecords = ({ records, selectedIndex, onSort, onAdd, onEdit, onDelete }: React.PropsWithChildren) => { if (!records || !records.length) { return null; } return (
Records
{ records.map((v: any, idx: number) => ( )) }
); };