UNPKG

subhasmitalmg-react-spreadsheet-import

Version:

React spreadsheet import for xlsx and csv files with column matching and validation steps

14 lines (12 loc) 317 B
const titleMap = { checkbox: "Boolean", select: "Options", input: "Text", }; const generateExampleRow = (fields) => [ fields.reduce((acc, field) => { acc[field.key] = field.example || titleMap[field.fieldType.type]; return acc; }, {}), ]; export { generateExampleRow };