/**
 * Approval node config
 */

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

import { useLanguage } from '../../../../providers/language/LanguageContext';

export const ApprovalNodeConfig: React.FC<NodeConfigRendererProps> = ({ params, updateParam }) => {
  const { t } = useLanguage();
  return (
    <>
      <div>
        <label>Titel</label>
        <input
          value={(params.title as string) ?? ''}
          onChange={(e) => updateParam('title', e.target.value)}
          placeholder="Genehmigungstitel"
        />
      </div>
      <div>
        <label>{t('approvalNodeConfig.beschreibung')}</label>
        <textarea
          value={(params.description as string) ?? ''}
          onChange={(e) => updateParam('description', e.target.value)}
          placeholder={t('approvalNodeConfig.wasGenehmigtWerdenSoll')}
        />
      </div>
    </>
  );
};
