UNPKG

leumas-universal-crud-react

Version:

Leumas Universal CRUD to a dynamic Endpoint, Setup your own Dynamic Endpoint and Use Leumas API to send to your MONGO clusters

934 lines (669 loc) 29.3 kB
// formTemplates.js export const createUserForm = [ [ { type: 'text', name: 'username', placeholder: 'Enter Username' }, { type: 'email', name: 'email', placeholder: 'Enter Email' }, ], [ { type: 'password', name: 'password', placeholder: 'Enter Password' }, ], // ... add more pages or inputs as needed ]; // LMS Library Forms export const createLibraryForm = [ [ { type: 'text', name: 'name', placeholder: 'Enter Library Name' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Library Description' }, ], [ { type: 'select', name: 'ownerType', options: ['User'], placeholder: 'Select Owner Type' }, { type: 'checkbox', name: 'public', label: 'Is Public?' }, ], // This assumes you have a pre-filled list of categories. If not, you'll need a different way to select or add categories. // [ // { type: 'multiSelect', name: 'categories', options: [], placeholder: 'Select Categories' }, // ], ]; export const createLibraryItemForm = (libraryId , CategoryId) => [ [ { type: 'text', name: 'name', placeholder: 'Enter Library Item Name' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Description (Optional)', defaultValue: 'No description provided' }, ], // This is a hypothetical file upload input type. Depending on your frontend framework/library, you might need a specialized component for file uploads. [ { type: 'hidden', name: 'library', value: libraryId}, { type: 'hidden', name: 'category', value: CategoryId}, { type: 'hidden', name: 'files', value: []}, { type: 'hidden', name: 'premium', label: 'Is Premium?' , defaultValue: false , value : false}, { type: 'hidden', name: 'public', label: 'Is Public?' , defaultValue: false , value: false }, ] ]; export const createCategoryForm = (libraryId) => [ [ { type: 'text', name: 'name', placeholder: 'Enter Category Name' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Description' }, ], [ { type: 'checkbox', name: 'public', label: 'Is Public?' }, ], // Hypothetical owner field if you want to manually set it. Otherwise, you can omit this. [ { type: 'select', name: 'ownerType', options: ['User', 'Admin'], placeholder: 'Select Owner Type' }, ], [ { type: 'hidden', name: 'library', value: libraryId} ] ]; // Leumas Estate / Home // formTemplates.js export const createHomeForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Home Title' }, ], [ { type: 'text', name: 'address', placeholder: 'Enter Address' }, ], [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner (User)' }, ], // [ // { type: 'multiSelect', name: 'invitedUsers', options: [], placeholder: 'Select Invited Users' }, // ], // [ // { type: 'multiSelect', name: 'devices', options: [], placeholder: 'Select Devices' }, // ], ]; // formTemplates.js export const createDeviceForm = [ [ { type: 'text', name: 'name', placeholder: 'Enter Device Name' }, ], [ { type: 'select', name: 'type', options: ['thermostat', 'light', 'camera'], placeholder: 'Select Device Type' }, ], [ { type: 'select', name: 'status', options: ['on', 'off'], placeholder: 'Select Device Status', defaultValue: 'off' }, ], [ // This represents one key-value pair. In a dynamic form, you could allow users to add more. { type: 'text', name: 'metaKey', placeholder: 'Enter Metadata Key' }, { type: 'text', name: 'metaValue', placeholder: 'Enter Metadata Value' }, ], ]; export const createAIModelForm = [ [ { type: 'text', name: 'name', placeholder: 'Enter AI Model Name' }, { type: 'text', name: 'imageUrl', placeholder: 'Enter AI Image URL (Optional)' }, { type: 'textarea', name: 'greeting', placeholder: 'Enter AI Greeting (Optional)' }, ], // [ // { type: 'fileUpload', name: 'trainingData', placeholder: 'Select Training Data (Optional)' }, // ], [ { type: 'number', name: 'usageCount', placeholder: 'Enter Usage Count (Optional)', default: 0 }, { type: 'number', name: 'pricePerUsage', placeholder: 'Price Per Usage (Optional)' }, ], [ { type: 'textarea', name: 'data', placeholder: 'Enter JSON Data (Optional)' }, { type: 'text', name: 'voiceId', placeholder: 'Enter Resemble Voice ID (Optional)' }, { type: 'checkbox', name: 'isPublished', default: false, label: 'Publish Model?' }, ], ]; // You'll also need logic for validating and potentially parsing the 'data' input to ensure it's valid JSON. export const createTrainingDataForm = [ [ // Dropdown to select the data type: 'string', 'json', or 'link' { type: 'select', name: 'dataType', options: ['string', 'json', 'link'], placeholder: 'Select Data Type' }, ], [ // Text input to capture the actual data. This assumes you will have some client-side logic to validate the input based on the chosen data type. { type: 'textarea', name: 'data', placeholder: 'Enter your data' }, ], [ // Dropdown to select the associated AI model. You'd populate this list dynamically based on the available AI models in your database. { type: 'select', name: 'model', options: [], placeholder: 'Select Associated AI Model' }, ], ]; // Conversations export const createConversationForm = [ [ // This assumes you have a pre-filled list of conversations. If not, you might need a different method for selecting a conversation. { type: 'text', name: 'title', placeholder: 'Enter Conversation Title (Optional)' }, { type: 'select', name: 'type', options: ['ai', 'user', 'both'], placeholder: 'Select Conversation' }, { type: 'AiModels', name: 'models', options: [], placeholder: 'Select Participants' }, ], ]; export const createMessageForm = [ [ // This assumes you have a pre-filled list of conversations. If not, you might need a different method for selecting a conversation. { type: 'select', name: 'conversationId', options: [], placeholder: 'Select Conversation' }, ], [ { type: 'text', name: 'sender', placeholder: 'Enter Message Sender' }, { type: 'textarea', name: 'content', placeholder: 'Enter Message Content' }, { type: 'date', name: 'timestamp', placeholder: 'Select Message Timestamp' } ], ]; export const createCommentForm = [ [ { type: 'select', name: 'entity', options: ['Product', 'Post', 'User', 'Other'], placeholder: 'Select Commented Entity' }, ], [ { type: 'text', name: 'entityId', placeholder: 'Enter Entity ID' }, // In real-world use, this would be populated based on context ], [ { type: 'textarea', name: 'text', placeholder: 'Enter Comment Text' }, ], [ // Dropdown to select the comment owner. In practice, you'd likely set this in the backend to the current user. { type: 'select', name: 'owner', options: [], placeholder: 'Select Comment Owner (Optional if set in backend)' }, ], ]; // Blog export const createBlogPostForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Blog Post Title' }, ], [ { type: 'textarea', name: 'content', placeholder: 'Enter Blog Post Content' }, ], [ // This can be a dynamic field where users can add multiple tags. { type: 'text', name: 'tags', placeholder: 'Enter tags separated by commas (e.g., tech, web, AI)' }, ], [ // Dropdown to select the owner. In practice, you'd likely set this in the backend to the current user. { type: 'select', name: 'owner', options: [], placeholder: 'Select Blog Post Owner (Optional if set in backend)' }, ] ]; //Products export const createProductForm = [ [ { type: 'text', name: 'name', placeholder: 'Enter Product Name' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Product Description' }, ], [ { type: 'number', name: 'price', placeholder: 'Enter Product Price', min: 0 }, ], [ { type: 'number', name: 'quantity', placeholder: 'Enter Product Quantity', min: 0 }, ], [ // Assuming you have a predefined set of categories, this can be a dropdown. If it's open-ended, then use a text input. { type: 'select', name: 'category', options: [], placeholder: 'Select Product Category' }, // Alternatively, if it's open-ended: // { type: 'text', name: 'category', placeholder: 'Enter Product Category' }, ], [ { type: 'text', name: 'brand', placeholder: 'Enter Product Brand (Optional)' }, ], [ { type: 'text', name: 'imageUrl', placeholder: 'Enter Product Image URL (Optional)' }, ] ]; export const createReviewForm = [ [ // Assuming you have a pre-populated dropdown of products. This can be dynamically fetched. { type: 'select', name: 'product', options: [], placeholder: 'Select Product' }, ], [ { type: 'text', name: 'title', placeholder: 'Enter Review Title' }, ], [ { type: 'textarea', name: 'body', placeholder: 'Write your review here...' }, ], [ { type: 'number', name: 'rating', min: 1, max: 5, placeholder: 'Rate (1-5)' }, ], [ { type: 'number', name: 'helpfulVotes', placeholder: 'Helpful Votes (Optional)', defaultValue: 0 }, ], ]; //Project export const createProjectForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Project Title' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Project Description' }, ], [ { type: 'date', name: 'startDate', placeholder: 'Select Start Date' }, ], [ { type: 'date', name: 'endDate', placeholder: 'Select End Date (Optional)' }, ], [ { type: 'select', name: 'status', options: [ { value: 'Planning', label: 'Planning' }, { value: 'In Progress', label: 'In Progress' }, { value: 'Completed', label: 'Completed' }, { value: 'On Hold', label: 'On Hold' }, { value: 'Cancelled', label: 'Cancelled' }, ], placeholder: 'Select Project Status' }, ] ]; //Link export const createLinkForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Link Title' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Link Description (Optional)' }, ], [ { type: 'text', name: 'url', placeholder: 'Enter URL' }, ], [ { type: 'checkbox', name: 'isPublic', label: 'Publicly Accessible' }, ], [ { type: 'text', name: 'tags', placeholder: 'Enter Tags (comma separated)' }, ], [ // Depending on the kind of metadata, you can use different input types. // Assuming it's a simple key-value string pair: { type: 'text', name: 'metadataKey', placeholder: 'Enter Metadata Key (Optional)' }, { type: 'text', name: 'metadataValue', placeholder: 'Enter Metadata Value (Optional)' }, ] ]; // Leumas Buttons export const LeumasButtonForm = () => [ ] // Leumas IDs export const createLeumasIdForm = (userID) => [ [ { type: 'text', name: 'firstName', placeholder: 'Legal First Name' }, { type: 'text', name: 'lastName', placeholder: 'Legal Last Name' }, { type: 'date', name: 'dateOfBirth', placeholder: 'Select date of birth' }, ], [ { type: 'serialCodeGenerator', name: 'serialCode', placeholder: 'Enter Serial Code' }, { type: 'barcodeGenerator', name: "barcode", value: userID, placeholder: 'Enter Barcode' }, ], [ { type: 'metamask', name: 'metaMaskOwnerWallet', placeholder: 'Connect with MetaMask' }, { type: 'owner', name: 'owner', value: userID, placeholder: userID }, ], ]; export const createLeumasApp = (userID , appId , coverPhoto) => [ [ { type: 'number', name: 'price', placeholder: 'Price' }, { type: 'select', name: 'priceFrequency', options: [ { value: 'one-time', label: 'One-time' }, { value: 'multi-use', label: 'Multi-use' }, ], placeholder: 'Select Price Frequency' }, { type: 'text', name: 'title', placeholder: 'Enter Title' }, { type: 'textarea', name: 'notes', placeholder: 'Enter Notes' }, { type: 'textarea', name: 'description', placeholder: 'Enter Description' }, { type: 'text', name: 'category', placeholder: 'Enter Category' }, { type: 'owner', name: 'owner', value: userID, placeholder: userID }, { type: 'nonChangeableText', name: 'relatedSkillId', value: appId, placeholder: appId }, { type: 'text', name: 'coverPhoto', value: coverPhoto, placeholder: coverPhoto }, { type: 'metamask', name: 'metaMaskWalletId', placeholder: 'Connect with MetaMask' } ], ]; export const createAudioForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Audio Title' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Audio Description' }, ], // For owner, you might want to have a dynamic dropdown fetched from your user database. // Here, I'm just showing a template structure: [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Audio Owner' }, ], [ { type: 'text', name: 'fileUrl', placeholder: 'Enter Audio File URL or Path' }, ], [ { type: 'number', name: 'duration', placeholder: 'Enter Audio Duration (in seconds)' }, ], [ { type: 'text', name: 'mimeType', placeholder: 'Enter MIME Type (e.g., "audio/mp3")' }, ], [ { type: 'checkbox', name: 'isPublic', label: 'Is the audio publicly accessible?' }, ], // For tags, this could vary based on UI. Here's a basic example with text: [ { type: 'text', name: 'tags', placeholder: 'Enter Tags (comma separated)' }, ], // Metadata can be complex. Here's a basic example with a textarea: [ { type: 'textarea', name: 'metadata', placeholder: 'Enter Metadata (in JSON format)' }, ], ]; export const createVideoForm = [ [ { type: 'text', name: 'title', placeholder: 'Enter Video Title', required: true }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Video Description' }, ], [ { type: 'text', name: 'videoURL', placeholder: 'Enter Video URL', required: true }, ], [ { type: 'text', name: 'thumbnailURL', placeholder: 'Enter Thumbnail URL' }, ], // For owner, you might want to have a dynamic dropdown fetched from your user database. // Here, I'm just showing a template structure: [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Video Owner', required: true }, ], [ { type: 'checkbox', name: 'isPublic', label: 'Is Public?', defaultValue: true }, { type: 'checkbox', name: 'isMonetized', label: 'Is Monetized?', defaultValue: false }, { type: 'checkbox', name: 'isCommentsAllowed', label: 'Are Comments Allowed?', defaultValue: true }, { type: 'checkbox', name: 'copyrightClaim', label: 'Any Copyright Claim?', defaultValue: false }, ], [ { type: 'textarea', name: 'copyrightClaimDetails', placeholder: 'Enter Copyright Claim Details' }, ], // For tags, this could vary based on UI. Here's a basic example with text: [ { type: 'text', name: 'tags', placeholder: 'Enter Tags (comma separated)' }, ], [ { type: 'text', name: 'category', placeholder: 'Enter Video Category' }, ], // No need for uploadDate as it's automatically set on upload [ { type: 'number', name: 'duration', placeholder: 'Enter Video Duration (in seconds)' }, ], // Comments might be managed elsewhere, so they might not be needed in this form. ]; export const createCodeSnippetForm = [ [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Snippet Owner' }, { type: 'text', name: 'title', placeholder: 'Select Snippet Title' }, ], [ { type: 'textarea', name: 'content', placeholder: 'Enter Code Snippet' }, ], [ { type: 'select', name: 'fileType', options: [ { value: 'python', label: 'Python' }, { value: 'solidity', label: 'Solidity' }, { value: `.js`, label: 'JavaScript' }, { value: 'java', label: 'Java' }, { value: 'html', label: 'HTML' }, { value: 'css', label: 'CSS' }, { value: 'ruby', label: 'Ruby' }, { value: 'go', label: 'Go' }, { value: 'rust', label: 'Rust' }, { value: 'php', label: 'PHP' }, { value: 'c', label: 'C' }, { value: 'c++', label: 'C++' }, { value: 'c#', label: 'C#' }, { value: 'typescript', label: 'TypeScript' }, { value: 'swift', label: 'Swift' }, { value: 'kotlin', label: 'Kotlin' }, { value: 'perl', label: 'Perl' }, { value: 'sql', label: 'SQL' }, { value: 'bash', label: 'Bash' }, { value: 'assembly', label: 'Assembly' }, { value: 'other', label: 'Other' }, ], placeholder: 'Select File Type' }, ], [ { type: 'text', name: 'tags', placeholder: 'Enter Tags (comma separated)' }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Description (Optional)' }, ], ]; export const createGPTPromptForm = [ [ { type: 'textarea', name: 'gptPrompt', placeholder: 'Enter GPT Prompt', required: true }, ], [ { type: 'checkbox', name: 'public', label: 'Make Public?', defaultValue: false, required: true }, ], [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ { type: 'multiselect', name: 'sharedWith', options: [], placeholder: 'Share With Users' }, ], // Note: We're excluding createdAt and updatedAt as they'll be automatically managed by the backend. ]; export const createIRSignalForm = [ [ { type: 'text', name: 'IRValue', placeholder: 'Enter IR Signal Value', required: true }, ], [ { type: 'checkbox', name: 'public', label: 'Make Public?', defaultValue: false, required: true }, ], [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ { type: 'multiselect', name: 'sharedWith', options: [], placeholder: 'Share With Users' }, ], // Note: We're excluding createdAt and updatedAt since they're automatically managed by the backend. ]; export const createVSCodeSnippetForm = [ [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ { type: 'text', name: 'name', placeholder: 'Enter Snippet Name', required: true }, ], [ { type: 'text', name: 'prefix', placeholder: 'Enter Snippet Prefix', required: true }, ], [ { type: 'textarea', name: 'body', placeholder: 'Enter Snippet Body (Multiple lines are supported)', required: true }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Snippet Description' }, ], [ { type: 'text', name: 'scope', placeholder: 'Enter Language Scope (e.g., "javascript", "html")' }, ], // Note: We're excluding createdAt since it's automatically managed by the backend. ]; export const createBatchFileSnippetForm = [ [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ { type: 'text', name: 'title', placeholder: 'Enter Batch File Title', required: true }, ], [ { type: 'textarea', name: 'content', placeholder: 'Enter Batch File Content', required: true }, ], [ { type: 'textarea', name: 'description', placeholder: 'Enter Batch File Description' }, ], [ // Depending on how you're implementing tags, this could be a multi-select, a series of checkboxes, or a specialized "tag input" component. { type: 'tags', name: 'tags', placeholder: 'Enter Tags (Separate by commas or spaces)' }, ], // Note: We're excluding createdAt and updatedAt since they're managed by the backend. ]; export const createShopForm = [ [ // Fields for page 1 { type: 'text', name: 'name', placeholder: 'Shop Name', required: true }, { type: 'textarea', name: 'description', placeholder: 'Shop Description' }, { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ // In createShopForm { type: 'metamask', name: 'metaMaskOwnerWallet', placeholder: 'Connect with MetaMask' } ], // ... other pages ]; export const createMarketplaceForm = [ [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, ], [ { type: 'text', name: 'name', placeholder: 'Marketplace Name', required: true }, ], [ { type: 'textarea', name: 'description', placeholder: 'Description' }, ], [ // In createShopForm { type: 'metamask', name: 'metaMaskOwnerWallet', placeholder: 'Connect with MetaMask' } ], // ... Add other marketplace-specific fields here. ]; export const createMarkdownForm = [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, { type: 'markdown', name: 'content', placeholder: 'Markdown Content', required: true }, { type: 'text', name: 'title', placeholder: 'Title' }, { type: 'textarea', name: 'description', placeholder: 'Description' }, { type: 'select', name: 'author', options: [], placeholder: 'Select Author' }, { type: 'tags', name: 'tags', placeholder: 'Add a tag', options: [] }, ]; export const createImageArrayForm = [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, { type: 'dynamicList', name: 'imageUrls', placeholder: 'Enter Image URL', required: true, addButtonLabel: 'Add another image URL' } ]; export const createEquationForm = [ { type: 'select', name: 'owner', options: [], placeholder: 'Select Owner', required: true }, { type: 'text', name: 'equation', placeholder: 'Enter Equation (e.g. y = mx + c)', required: true }, { type: 'dynamicSection', name: 'variables', fields: [ { type: 'text', name: 'name', placeholder: 'Variable Name', required: true }, { type: 'text', name: 'description', placeholder: 'Description', required: true }, { type: 'number', name: 'value', placeholder: 'Value (optional)', required: false } ], addButtonLabel: 'Add another variable' } ]; export const createSocialPostForm = [ { type: 'textarea', name: 'content', placeholder: 'Whats on your mind?', required: true }, { type: 'file', name: 'imageUrl', placeholder: 'Upload an image', required: false }, { type: 'file', name: 'videoUrl', placeholder: 'Upload a video', required: false }, { type: 'text', name: 'location', placeholder: 'Tag a location', required: false }, { type: 'tags', name: 'tags', placeholder: 'Add tags or mentions', required: false }, { type: 'select', name: 'visibility', options: ['Public', 'Friends', 'Private'], placeholder: 'Select post visibility', required: true, default: 'Public' } ]; export const createCompanyForm = [ ]; export const createRecipeForm = [ { type: 'text', name: 'title', placeholder: 'Recipe Title', required: true }, { type: 'textarea', name: 'description', placeholder: 'Brief Description', required: true }, { type: 'dynamic', name: 'ingredients', fields: [ { type: 'text', name: 'name', placeholder: 'Ingredient Name', required: true }, { type: 'text', name: 'quantity', placeholder: 'Quantity', required: false } ], label: 'Ingredients' }, { type: 'dynamic', name: 'instructions', fields: [ { type: 'number', name: 'step', placeholder: 'Step Number', required: true }, { type: 'text', name: 'description', placeholder: 'Instruction', required: true } ], label: 'Instructions' }, { type: 'number', name: 'prepTime', placeholder: 'Preparation Time (minutes)', required: true }, { type: 'number', name: 'cookTime', placeholder: 'Cooking Time (minutes)', required: true }, { type: 'number', name: 'servings', placeholder: 'Number of Servings', required: true } ]; // Fine-Tuning Model Form Configuration export const createFineTuningForm = [ [ { type: 'text', name: 'training_file', placeholder: 'Enter Training File ID' }, ], [ { type: 'text', name: 'validation_file', placeholder: 'Enter Validation File ID (Optional)' }, ], [ { type: 'text', name: 'model', placeholder: 'Enter Model Name (e.g., gpt-3.5-turbo)' }, ], [ { type: 'text', name: 'suffix', placeholder: 'Enter Custom Suffix for Model Name (Optional)' }, ], [ // If you have hyperparameters, you might want to allow users to input them. // Depending on the hyperparameters you're considering, the input types may vary. // For simplicity, I'm assuming a learning rate and batch size as example hyperparameters. { type: 'number', name: 'learning_rate', placeholder: 'Enter Learning Rate (e.g., 0.001)' }, { type: 'number', name: 'batch_size', placeholder: 'Enter Batch Size (e.g., 64)' }, ], ]; export const testForm = [ [ { type: 'text', name: 'Text Input', placeholder: 'Enter Text', label: "Text Input" }, { type: 'password', name: 'Password Input', placeholder: 'Enter Password' }, { type: 'email', name: 'Email Input', placeholder: 'Enter Email' }, { type: 'number', name: 'Number Input', placeholder: 'Enter Number' }, { type: 'date', name: 'Date Input', placeholder: 'Date' }, { type: 'textarea', name: 'Textarea Input', placeholder: 'Textarea...' }, { type: 'metamask', name: 'Textarea Input', placeholder: 'Textarea...' }, { type: 'select', name: 'Select Input', options: ['Public', 'Friends', 'Private'], placeholder: 'Select Options', required: true }, { type: 'multiselect', name: 'sharedWith', options: [], placeholder: 'Share With Users' }, { type: 'checkbox', name: 'Checkbox Input', label: 'Checkbox Input' }, { type: 'AiModels', name: 'models', options: [], placeholder: 'Select AI Model' }, { type: 'slider', name: 'slider', options: [], placeholder: 'Slider', label: "Slider Input" , min: 0 , max: 1000 }, { type: 'nonChangeableText', name: 'Non Changeable Text Input', value: "Pass In a Value Through Form", placeholder: "Pass In a Value Through Form" }, { type: 'fileUpload', name: 'File Upload Input', placeholder: 'Upload a File' }, { type: 'folderUpload', name: 'File Upload Input', placeholder: 'Upload a File' }, { type: 'imageUpload', name: 'Image Upload Input', placeholder: 'Upload a File' }, // { type: 'code', name: 'Code Upload Input', placeholder: 'Enter code' }, // { type: 'splitCode', name: 'Split Code Upload Input', placeholder: 'Enter code' }, { type: 'serialCodeGenerator', name: 'Serial Code Generator', placeholder: 'Enter Serial Code' }, { type: 'barcodeGenerator', name: "Barcode Generator", value: "Some Value through props of form", placeholder: 'Some Value through props of form' }, ] ] const formMap = { library: createLibraryForm, libraryItem: createLibraryItemForm, category: createCategoryForm, conversation: createConversationForm // ... add all other forms }; export const getForm = (type, ...params) => { return formMap[type]?.(...params) || []; };