"use client"; import React, { useState } from "react"; import { useApp } from "@/components/AppContext"; import { notFound } from "next/navigation"; const translations = { en: { workflowsTitle: "Workflows", workflowsSubtitle: "Monitor active n8n webhooks and background integration pipelines.", n8nWebhookIntegration: "n8n Webhook Integration", webhookDesc: "This webhook coordinates CV processing and automatic screening candidates scores updates.", statusLabel: "Status:", activeStatus: "Active", inactiveStatus: "Inactive / Missing Env", webhookUrlLabel: "Active Webhook Target URL", noUrlConfigured: "No webhook URL configured. Set NEXT_PUBLIC_N8N_WEBHOOK_URL in environment.", copied: "Copied!", copy: "Copy", automatedPipeline: "Automated Recruitment Pipeline Execution", step1Title: "CV Ingestion:", step1Desc: " CVs uploaded on the Jobs screen are parsed, and candidate records are stored in Supabase with candidate vector embeddings.", step2Title: "Webhook Trigger:", step2Desc: " The backend route calls the n8n webhook URL with candidate meta-information and parsed CV text.", step3Title: "AI Review & Evaluation:", step3Desc: " n8n runs the screening workflow, generates scores, sets classification fields, and populates the database suggestions." }, es: { workflowsTitle: "Flujos de Trabajo", workflowsSubtitle: "Monitoree los webhooks de n8n activos y los flujos de integración en segundo plano.", n8nWebhookIntegration: "Integración de Webhook de n8n", webhookDesc: "Este webhook coordina el procesamiento de CV y las actualizaciones automáticas de puntuación de candidatos preseleccionados.", statusLabel: "Estado:", activeStatus: "Activo", inactiveStatus: "Inactivo / Falta Env", webhookUrlLabel: "URL de Destino del Webhook Activo", noUrlConfigured: "No se configuró la URL del webhook. Establezca NEXT_PUBLIC_N8N_WEBHOOK_URL en el entorno.", copied: "¡Copiado!", copy: "Copiar", automatedPipeline: "Ejecución del Pipeline de Reclutamiento Automatizado", step1Title: "Ingesta de CV:", step1Desc: " Los CV cargados en la pantalla de Vacantes se analizan y los registros de los candidatos se almacenan en Supabase con sus embeddings vectoriales.", step2Title: "Activación de Webhook:", step2Desc: " La ruta del backend llama a la URL del webhook de n8n con la metainformación del candidato y el texto analizado del CV.", step3Title: "Revisión y Evaluación con IA:", step3Desc: " n8n ejecuta el flujo de trabajo de preselección, genera puntuaciones, establece campos de clasificación y llena las sugerencias en la base de datos." } }; export default function WorkflowsPage() { if (process.env.NODE_ENV === "production") { notFound(); } const { lang } = useApp(); const t = translations[lang]; const webhookUrl = process.env.NEXT_PUBLIC_N8N_WEBHOOK_URL || ""; const [copied, setCopied] = useState(false); const handleCopy = () => { if (webhookUrl) { navigator.clipboard.writeText(webhookUrl); setCopied(true); setTimeout(() => setCopied(false), 2000); } }; return (
{t.workflowsSubtitle}
{t.webhookDesc}
{t.step1Title}{t.step1Desc}
{t.step2Title}{t.step2Desc}
{t.step3Title}{t.step3Desc}