analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
67 lines • 2.73 kB
TypeScript
import type { TableParams, ColumnConfig } from '../../TableProvider/index';
import type { FilterConfig } from '../../Filter/useTableFilter/index';
import type { ReactNode } from 'react';
/**
* Tab configuration for BasePageLayout
*/
export interface TabConfig {
value: string;
label: string;
testId: string;
}
/**
* Props for the BasePageLayout component
*/
export interface BasePageLayoutProps<T extends Record<string, unknown>> {
/** Current active tab value */
activeTab: string;
/** 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., "provas", "atividades") */
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;
/** Tab configuration */
tabs: TabConfig[];
/** Label for the create button */
createButtonLabel: 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: string) => void;
/** Callback when the create button is clicked */
onCreate: () => void;
}
/**
* Shared base layout component for list pages (History, Drafts, Models).
* Provides consistent structure with tabs navigation, search, filters, and table display.
* Used by ExamPageLayout and ActivityPageLayout.
* @returns JSX element representing the page layout
*/
export declare function BasePageLayout<T extends Record<string, unknown>>({ activeTab, pageTitle, headerRightContent, testId, data, headers, loading, error, pagination, initialFilters, itemLabel, searchPlaceholder, emptyState, noSearchImage, tabs, createButtonLabel, onParamsChange, onRowClick, onTabChange, onCreate, }: Readonly<BasePageLayoutProps<T>>): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=BasePageLayout.d.ts.map