UNPKG

analytica-frontend-lib

Version:

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

98 lines 3.34 kB
import { type HTMLAttributes, type ReactNode } from 'react'; import { PROFILE_ROLES } from '../types/chat'; import type { StudentsHighlightPeriod } from '../hooks/useStudentsHighlight'; /** * Re-export period type for API consumers */ export type { StudentsHighlightPeriod as PerformanceQuestionsPeriod } from '../hooks/useStudentsHighlight'; /** * Data for STUDENT variant: question statistics */ export interface QuestionsVariantData { total: number; correct: number; incorrect: number; blank: number; } /** * Data for non-STUDENT variant: produced content */ export interface ContentVariantData { total: number; totalActivities: number; totalRecommendedLessons: number; } export interface PerformanceFilterOption { value: string; label: string; } export interface PerformanceFilterConfig { options: PerformanceFilterOption[]; value: string; onChange: (value: string) => void; placeholder?: string; /** Icon rendered before the select value */ icon?: ReactNode; } export interface PerformanceQuestionsRequest { period: StudentsHighlightPeriod; targetProfile: PROFILE_ROLES; schoolIds?: string[]; schoolGroupIds?: string[]; allSchoolGroupsSelected?: boolean; subjectIds?: string[]; allSubjectsSelected?: boolean; activityTypes?: string[]; } export interface PerformanceQuestionsStudentResponse { message: string; data: QuestionsVariantData; } export interface PerformanceQuestionsDefaultResponse { message: string; data: ContentVariantData; } export declare enum PerformanceQuestionsVariant { QUESTIONS = "questions", CONTENT = "content" } export interface PerformanceQuestionsDataProps extends HTMLAttributes<HTMLDivElement> { /** Variant determines title, bars, and colors */ variant: PerformanceQuestionsVariant; /** Chart data (shape depends on variant) */ data: QuestionsVariantData | ContentVariantData; /** Subject/discipline filter configuration */ subjectFilter?: PerformanceFilterConfig; /** Activity type filter configuration */ activityTypeFilter?: PerformanceFilterConfig; /** Maximum value for the chart scale (defaults to total) */ maxValue?: number; /** Height of the chart area in pixels */ chartHeight?: number; } /** * PerformanceQuestionsData component - displays a vertical bar chart * with variant-specific data for performance reports. * * - `variant="questions"` (STUDENT): Total, Correct, Incorrect, Blank * - `variant="content"` (non-STUDENT): Total, Activities, Recommended Lessons * * Includes optional integrated Select filters for subjects and activity types. * * @example * ```tsx * <PerformanceQuestionsData * variant="questions" * data={{ total: 100, correct: 60, incorrect: 30, blank: 10 }} * subjectFilter={{ * options: [{ value: 'all', label: 'Todos componentes' }], * value: 'all', * onChange: (v) => setSubject(v), * placeholder: 'Todos componentes', * }} * /> * ``` */ export declare const PerformanceQuestionsData: ({ variant, data, subjectFilter, activityTypeFilter, maxValue, chartHeight, className, ...props }: PerformanceQuestionsDataProps) => import("react/jsx-runtime").JSX.Element; export default PerformanceQuestionsData; //# sourceMappingURL=PerformanceQuestionsData.d.ts.map