UNPKG

analytica-frontend-lib

Version:

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

64 lines 2.68 kB
import type { ReactNode } from 'react'; import type { TableParams, ColumnConfig } from '../TableProvider/index'; import type { FilterConfig } from '../Filter/useTableFilter/index'; /** * Enum for activity page tabs */ export declare enum ActivityTab { HISTORY = "historico", DRAFTS = "rascunhos", MODELS = "modelos" } /** * Props for the ActivityPageLayout component */ export interface ActivityPageLayoutProps<T extends Record<string, unknown>> { /** Current active tab */ activeTab: ActivityTab; /** Page title displayed in the header */ pageTitle: string; /** Optional content rendered to the right of the page title (e.g., type selector) */ headerRightContent?: ReactNode; /** Test ID for the page container */ testId: string; /** Data to display in the table */ data: T[]; /** Table column headers configuration */ headers: ColumnConfig<T>[]; /** Whether data is loading */ loading: boolean; /** Error message if any */ error: string | null; /** Pagination configuration */ pagination: { total: number; totalPages: number; }; /** Initial filter configuration */ initialFilters?: FilterConfig[]; /** Label for pagination items (e.g., "atividades", "rascunhos") */ itemLabel: string; /** Search placeholder text */ searchPlaceholder: string; /** Empty state component rendered inside the table */ emptyState: ReactNode; /** Image shown when search returns no results */ noSearchImage: string; /** Callback when table params change (search, sort, pagination) */ onParamsChange: (params: TableParams) => void; /** Callback when a row is clicked */ onRowClick: (row: T) => void; /** Callback when a tab is changed */ onTabChange: (tab: ActivityTab) => void; /** Callback when the create activity button is clicked */ onCreateActivity: () => void; /** Label for the create button (default: "Criar atividade") */ createButtonLabel?: string; } /** * Layout component for activity pages (History, Drafts, Models). * Wraps BasePageLayout with activity-specific configuration. * @returns JSX element representing the activity page layout */ export declare function ActivityPageLayout<T extends Record<string, unknown>>({ activeTab, pageTitle, headerRightContent, testId, data, headers, loading, error, pagination, initialFilters, itemLabel, searchPlaceholder, emptyState, noSearchImage, onParamsChange, onRowClick, onTabChange, onCreateActivity, createButtonLabel, }: Readonly<ActivityPageLayoutProps<T>>): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=ActivityPageLayout.d.ts.map