/**
 * Start node (trigger.manual) — documentation only. Entry points are configured
 * on the workflow (Starts), not on this node.
 */

import React from 'react';
import type { NodeConfigRendererProps } from '../shared/types';
import styles from '../../editor/Automation2FlowEditor.module.css';
import { useLanguage } from '../../../../providers/language/LanguageContext';

const SCHEMA_EXAMPLE = `{
  "trigger": {
    "type": "manual | form | schedule | email | webhook | api | event",
    "entryPointId": "…",
    "label": "…"
  },
  "payload": {},
  "context": {},
  "files": [],
  "user": {},
  "metadata": {},
  "raw": {}
}`;

export const StartNodeConfig: React.FC<NodeConfigRendererProps> = () => {
  const { t } = useLanguage();
  return (
    <div className={styles.startNodeDoc}>
      <p className={styles.startNodeDocIntro}>
        {t(
          'Die Start-Node liefert beim Ausführen immer dieselbe Struktur. Den Einstiegstyp (manuell, Formular, Zeitplan, …) wählen Sie über das Zahnrad oben in der Workflow-Konfiguration.'
        )}
      </p>
      <p className={styles.startNodeDocSub}>
        {t('Nachgelagerte Nodes können z. B. auf')}{' '}
        <code>payload</code> {t('und')} <code>trigger.type</code> {t('zugreifen.')}
      </p>
      <div className={styles.startNodeSchema}>
        <div className={styles.startNodeSchemaTitle}>{t('Ausgabe-Schema')}</div>
        <pre className={styles.startNodePre}>{SCHEMA_EXAMPLE}</pre>
      </div>
    </div>
  );
};
