"use client" import { useState } from "react" import { mockRequisitions, mockCandidates, mockDepartments } from "@/lib/mock-data" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Badge } from "@/components/ui/badge" import { Progress } from "@/components/ui/progress" import { BarChart3, TrendingUp, TrendingDown, Download, Calendar, Users, Clock, Target, Building2, Briefcase, CheckCircle2, XCircle, PieChart, Activity, ArrowUpRight, ArrowDownRight, FileText, Filter } from "lucide-react" import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, LineChart, Line, PieChart as RechartsPieChart, Pie, Cell, AreaChart, Area } from "recharts" // Sample data for charts const requisitionsByMonth = [ { month: "Ene", creadas: 12, aprobadas: 10, cubiertas: 8 }, { month: "Feb", creadas: 15, aprobadas: 13, cubiertas: 11 }, { month: "Mar", creadas: 18, aprobadas: 16, cubiertas: 14 }, { month: "Abr", creadas: 14, aprobadas: 12, cubiertas: 10 }, { month: "May", creadas: 20, aprobadas: 18, cubiertas: 15 }, { month: "Jun", creadas: 16, aprobadas: 14, cubiertas: 12 } ] const candidatesBySource = [ { name: "LinkedIn", value: 45, color: "#0077B5" }, { name: "Referidos", value: 25, color: "#61ce70" }, { name: "Portal Empleo", value: 18, color: "#6ec1e4" }, { name: "Website", value: 8, color: "#4054b2" }, { name: "Agencias", value: 4, color: "#54595f" } ] const timeToHire = [ { month: "Ene", dias: 35 }, { month: "Feb", dias: 32 }, { month: "Mar", dias: 28 }, { month: "Abr", dias: 30 }, { month: "May", dias: 25 }, { month: "Jun", dias: 22 } ] const requisitionsByDepartment = [ { name: "Tecnologia", abiertas: 8, cubiertas: 15 }, { name: "Ventas", abiertas: 5, cubiertas: 12 }, { name: "Marketing", abiertas: 3, cubiertas: 8 }, { name: "Operaciones", abiertas: 4, cubiertas: 10 }, { name: "Finanzas", abiertas: 2, cubiertas: 6 }, { name: "RR.HH.", abiertas: 1, cubiertas: 4 } ] const pipelineConversion = [ { stage: "Aplicados", count: 500, percentage: 100 }, { stage: "Screening", count: 250, percentage: 50 }, { stage: "Entrevista RH", count: 120, percentage: 24 }, { stage: "Entrevista Tec", count: 60, percentage: 12 }, { stage: "Entrevista Ger", count: 30, percentage: 6 }, { stage: "Oferta", count: 15, percentage: 3 }, { stage: "Contratados", count: 12, percentage: 2.4 } ] export function ReportsPage() { const [dateRange, setDateRange] = useState("6m") const [selectedDepartment, setSelectedDepartment] = useState("all") // Calculate stats const totalRequisitions = mockRequisitions.length const openRequisitions = mockRequisitions.filter(r => ["draft", "pending", "approved", "published"].includes(r.status) ).length const closedRequisitions = mockRequisitions.filter(r => ["filled", "cancelled"].includes(r.status) ).length const totalCandidates = mockCandidates.length const hiredCandidates = mockCandidates.filter(c => c.currentStage === "hired").length const avgTimeToHire = 27 // days return (
Metricas y estadisticas del proceso de reclutamiento