/**
 * Upload node config
 */

import React from 'react';
import type { NodeConfigRendererProps } from './types';

export const UploadNodeConfig: React.FC<NodeConfigRendererProps> = ({ params, updateParam }) => (
  <>
    <div>
      <label>Accept (MIME)</label>
      <input
        value={(params.accept as string) ?? ''}
        onChange={(e) => updateParam('accept', e.target.value)}
        placeholder=".pdf,image/*"
      />
    </div>
    <div>
      <label>Max Größe (MB)</label>
      <input
        type="number"
        value={(params.maxSize as number) ?? 10}
        onChange={(e) => updateParam('maxSize', parseFloat(e.target.value) || 0)}
      />
    </div>
    <div>
      <label>
        <input
          type="checkbox"
          checked={(params.multiple as boolean) ?? false}
          onChange={(e) => updateParam('multiple', e.target.checked)}
        />
        Mehrere Dateien
      </label>
    </div>
  </>
);
