Refactor components and scripts for improved typing, cleanup unused imports

- Updated chart components (`OrganizationDistributionChart`, `RegistrationActivityChart`, `UserGrowthChart`) with stricter TypeScript interfaces (`TooltipProps`).
- Removed unused imports (`useState`, `Badge`, `API_BASE_URL`) from `DemoModeBanner` and MSW scripts.
- Adjusted MSW function parameters (`_method`, `_operation`) to suppress unused variable warnings.
This commit is contained in:
Felipe Cardoso
2025-11-24 20:30:58 +01:00
parent e79215b4de
commit 6b970765ba
5 changed files with 20 additions and 8 deletions

View File

@@ -66,7 +66,7 @@ function convertPathToMSWPattern(path: string): string {
return path.replace(/\{([^}]+)\}/g, ':$1');
}
function shouldSkipEndpoint(path: string, method: string): boolean {
function shouldSkipEndpoint(path: string, _method: string): boolean {
// Skip health check and root endpoints
if (path === '/' || path === '/health') return true;
@@ -83,7 +83,7 @@ function getHandlerCategory(path: string): 'auth' | 'users' | 'admin' | 'organiz
return 'users';
}
function generateMockResponse(path: string, method: string, operation: any): string {
function generateMockResponse(path: string, method: string, _operation: any): string {
const category = getHandlerCategory(path);
// Auth endpoints
@@ -267,7 +267,6 @@ function generateMockResponse(path: string, method: string, operation: any): str
function generateHandlers(spec: OpenAPISpec): string {
const handlers: string[] = [];
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:8000';
for (const [pathPattern, pathItem] of Object.entries(spec.paths)) {
for (const [method, operation] of Object.entries(pathItem)) {