Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 5x 5x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x | /**
* @file useFooterState.ts
* @module app/footer/useFooterState
*
* @summary
* Custom hook for managing footer state and health monitoring.
* Encapsulates footer state (details collapse) and health status data.
*
* @enterprise
* - Separates footer state management from UI components
* - Integrates with useHealthCheck hook for health monitoring
* - Provides localization metadata (language, region)
* - Type-safe footer configuration
* - Full TypeDoc coverage for all exported functions
*/
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useHealthCheck } from '../../features/health';
/**
* Footer configuration interface.
*/
interface FooterConfig {
appVersion: string;
buildId: string;
environment: string;
currentLanguage: string;
region: string;
}
/**
* Hook for managing footer state and configuration.
*
* Provides footer state (details open/close), health status, and metadata.
* Integrates with i18n for localization and useHealthCheck for system monitoring.
*
* @returns Object containing footer state, config, and callbacks
*
* @example
* ```tsx
* const { detailsOpen, toggleDetails, health, config } = useFooterState();
* ```
*/
export function useFooterState() {
const { i18n } = useTranslation(['common']);
const { health } = useHealthCheck();
// Footer details collapse state
const [detailsOpen, setDetailsOpen] = React.useState(false);
/**
* Toggle footer details panel open/close.
*/
const toggleDetails = () => {
setDetailsOpen((prev) => !prev);
};
/**
* Footer configuration extracted from i18n and hardcoded values.
*/
const config: FooterConfig = {
appVersion: '1.0.0',
buildId: '4a9c12f',
environment: 'Production (Koyeb)',
currentLanguage: i18n.language.split('-')[0].toUpperCase(),
region: 'DE',
};
return {
detailsOpen,
toggleDetails,
health,
config,
};
}
|