{"version":3,"sources":["../src/components/PerformanceReport/PerformanceReport.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode } from 'react';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\nimport { PROFILE_ROLES } from '../../types/chat';\nimport type { StudentsHighlightPeriod } from '../../hooks/useStudentsHighlight';\nimport { ReportLayout } from '../shared/ReportLayout';\n\n/**\n * API types - reusing existing enums/types from the project\n */\nexport { PROFILE_ROLES } from '../../types/chat';\nexport type { StudentsHighlightPeriod as PerformanceReportPeriod } from '../../hooks/useStudentsHighlight';\n\nexport interface PerformanceReportRequest {\n  period: StudentsHighlightPeriod;\n  profile?: PROFILE_ROLES;\n  schoolGroupIds?: string[];\n  schoolIds?: string[];\n  allSchoolGroups?: boolean;\n}\n\nexport interface PerformanceStudentData {\n  cities: number;\n  schools: number;\n  classes: number;\n  students: number;\n  teachers: number;\n}\n\nexport interface PerformanceDefaultData {\n  activities: number;\n  recommendedLessons: number;\n}\n\nexport interface PerformanceReportResponse {\n  message: string;\n  data: PerformanceStudentData | PerformanceDefaultData;\n}\n\n/**\n * Data for a single performance card\n */\nexport interface PerformanceCardData {\n  /** Unique identifier */\n  id: string;\n  /** Uppercase label (e.g., \"CIDADES\", \"ESCOLAS\") */\n  label: string;\n  /** Numeric or formatted value (e.g., 42, \"1.200\") */\n  value: string | number;\n  /** Icon element for the card */\n  icon: ReactNode;\n}\n\n/**\n * Tab configuration for the PerformanceReport component\n */\nexport interface PerformanceReportTab {\n  /** Unique value identifying this tab */\n  value: string;\n  /** Display label */\n  label: string;\n  /** Icon element for the tab header */\n  icon?: ReactNode;\n  /** Cards to display when this tab is active */\n  cards: PerformanceCardData[];\n}\n\n/**\n * Props for the PerformanceCard component\n */\nexport interface PerformanceCardProps extends HTMLAttributes<HTMLDivElement> {\n  /** Card data */\n  data: PerformanceCardData;\n}\n\n/**\n * Props for the PerformanceReport component\n */\nexport interface PerformanceReportProps extends HTMLAttributes<HTMLDivElement> {\n  /** Tab configurations with associated card data */\n  tabs: PerformanceReportTab[];\n  /** Default active tab value */\n  defaultTab?: string;\n  /** Controlled active tab value */\n  activeTab?: string;\n  /** Callback when active tab changes */\n  onTabChange?: (value: string) => void;\n}\n\n/**\n * PerformanceCard component - displays a single performance statistic\n */\nexport const PerformanceCard = ({\n  data,\n  className,\n  ...props\n}: PerformanceCardProps) => {\n  const { label, value, icon } = data;\n\n  return (\n    <div\n      className={cn(\n        'flex flex-col gap-3 p-5 bg-background border border-border-50 rounded-xl',\n        className\n      )}\n      data-testid={`performance-card-${data.id}`}\n      {...props}\n    >\n      {/* Icon + Label */}\n      <div className=\"flex flex-row items-center gap-2\">\n        <span className=\"text-text-600 [&>svg]:w-4 [&>svg]:h-4\">{icon}</span>\n        <Text\n          weight=\"bold\"\n          className=\"text-text-600 uppercase text-[8px] leading-[100%]\"\n        >\n          {label}\n        </Text>\n      </div>\n\n      {/* Value */}\n      <Text\n        size=\"2xl\"\n        weight=\"bold\"\n        className=\"text-primary-800 leading-[100%] tracking-[0.2px]\"\n      >\n        {value}\n      </Text>\n    </div>\n  );\n};\n\n/**\n * PerformanceReport component\n *\n * Displays performance statistics organized in tabs, each with configurable cards.\n * Used in the manager report page to show performance metrics (counts, not time).\n *\n * @example\n * ```tsx\n * <PerformanceReport\n *   tabs={[\n *     {\n *       value: 'student',\n *       label: 'Estudante',\n *       icon: <Student size={17} />,\n *       cards: [\n *         { id: 'cities', label: 'CIDADES', value: 42, icon: <MapPin /> },\n *       ],\n *     },\n *   ]}\n *   onTabChange={(tab) => console.log(tab)}\n * />\n * ```\n */\nexport const PerformanceReport = ({\n  tabs,\n  defaultTab,\n  activeTab,\n  onTabChange,\n  className,\n  ...props\n}: PerformanceReportProps) => (\n  <ReportLayout\n    tabs={tabs}\n    defaultTab={defaultTab}\n    activeTab={activeTab}\n    onTabChange={onTabChange}\n    renderCard={(card) => <PerformanceCard key={card.id} data={card} />}\n    gridTestId=\"performance-report-cards\"\n    className={className}\n    {...props}\n  />\n);\n\nexport default PerformanceReport;\n"],"mappings":";;;;;;;;;;;AA6GM,SACE,KADF;AAjBC,IAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,EAAE,OAAO,OAAO,KAAK,IAAI;AAE/B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACA,eAAa,oBAAoB,KAAK,EAAE;AAAA,MACvC,GAAG;AAAA,MAGJ;AAAA,6BAAC,SAAI,WAAU,oCACb;AAAA,8BAAC,UAAK,WAAU,yCAAyC,gBAAK;AAAA,UAC9D;AAAA,YAAC;AAAA;AAAA,cACC,QAAO;AAAA,cACP,WAAU;AAAA,cAET;AAAA;AAAA,UACH;AAAA,WACF;AAAA,QAGA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAO;AAAA,YACP,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAyBO,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,CAAC,SAAS,oBAAC,mBAA8B,MAAM,QAAf,KAAK,EAAgB;AAAA,IACjE,YAAW;AAAA,IACX;AAAA,IACC,GAAG;AAAA;AACN;AAGF,IAAO,4BAAQ;","names":[]}