UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

106 lines 3.35 kB
import { type HTMLAttributes, type ReactNode } from 'react'; import { PROFILE_ROLES } from '../types/chat'; import type { StudentsHighlightPeriod } from '../hooks/useStudentsHighlight'; /** * API types - reusing existing enums/types from the project */ export { PROFILE_ROLES } from '../types/chat'; export type { StudentsHighlightPeriod as PerformanceReportPeriod } from '../hooks/useStudentsHighlight'; export interface PerformanceReportRequest { period: StudentsHighlightPeriod; profile?: PROFILE_ROLES; schoolGroupIds?: string[]; schoolIds?: string[]; allSchoolGroups?: boolean; } export interface PerformanceStudentData { cities: number; schools: number; classes: number; students: number; teachers: number; } export interface PerformanceDefaultData { activities: number; recommendedLessons: number; } export interface PerformanceReportResponse { message: string; data: PerformanceStudentData | PerformanceDefaultData; } /** * Data for a single performance card */ export interface PerformanceCardData { /** Unique identifier */ id: string; /** Uppercase label (e.g., "CIDADES", "ESCOLAS") */ label: string; /** Numeric or formatted value (e.g., 42, "1.200") */ value: string | number; /** Icon element for the card */ icon: ReactNode; } /** * Tab configuration for the PerformanceReport component */ export interface PerformanceReportTab { /** Unique value identifying this tab */ value: string; /** Display label */ label: string; /** Icon element for the tab header */ icon?: ReactNode; /** Cards to display when this tab is active */ cards: PerformanceCardData[]; } /** * Props for the PerformanceCard component */ export interface PerformanceCardProps extends HTMLAttributes<HTMLDivElement> { /** Card data */ data: PerformanceCardData; } /** * Props for the PerformanceReport component */ export interface PerformanceReportProps extends HTMLAttributes<HTMLDivElement> { /** Tab configurations with associated card data */ tabs: PerformanceReportTab[]; /** Default active tab value */ defaultTab?: string; /** Controlled active tab value */ activeTab?: string; /** Callback when active tab changes */ onTabChange?: (value: string) => void; } /** * PerformanceCard component - displays a single performance statistic */ export declare const PerformanceCard: ({ data, className, ...props }: PerformanceCardProps) => import("react/jsx-runtime").JSX.Element; /** * PerformanceReport component * * Displays performance statistics organized in tabs, each with configurable cards. * Used in the manager report page to show performance metrics (counts, not time). * * @example * ```tsx * <PerformanceReport * tabs={[ * { * value: 'student', * label: 'Estudante', * icon: <Student size={17} />, * cards: [ * { id: 'cities', label: 'CIDADES', value: 42, icon: <MapPin /> }, * ], * }, * ]} * onTabChange={(tab) => console.log(tab)} * /> * ``` */ export declare const PerformanceReport: ({ tabs, defaultTab, activeTab, onTabChange, className, ...props }: PerformanceReportProps) => import("react/jsx-runtime").JSX.Element; export default PerformanceReport; //# sourceMappingURL=PerformanceReport.d.ts.map