Files
metabuilder/docs/archive/src/hooks
johndoe6345789 b3e17e7dd4 feat: Add troubleshooting guide and enhance act scripts
- Created a new troubleshooting guide in README.md for common issues and testing problems.
- Updated package.json to include new act commands for linting, type checking, building, and diagnosing workflows.
- Added a pre-commit hook script to validate workflows before commits.
- Enhanced run-act.sh script with logging, Docker checks, and improved output formatting.
- Improved test-workflows.sh with an interactive menu and performance tracking.
- Introduced setup-act.sh for quick setup and testing of act integration.
2025-12-25 13:16:45 +00:00
..

React Hooks

Overview

Custom React hooks for common functionality across the application.

Location

/src/hooks/

Available Hooks

useMobile

  • File: use-mobile.ts
  • Purpose: Detects mobile device viewport and provides responsive behavior
  • Returns: Boolean indicating if device is mobile

useDBAL

  • File: useDBAL.ts
  • Purpose: Provides access to DBAL (Data Abstraction Layer) for database queries
  • Returns: DBAL client instance with query methods

useKV

  • File: useKV.ts
  • Purpose: Key-value storage hook for component-level state or cached data
  • Returns: Object with get/set/delete methods for key-value operations

Usage Examples

import { useMobile } from '@/hooks/use-mobile'
import { useDBAL } from '@/hooks/useDBAL'
import { useKV } from '@/hooks/useKV'

// Mobile detection
const isMobile = useMobile()

// Database access
const dbal = useDBAL()
const data = await dbal.query(...)

// Key-value storage
const kv = useKV()
kv.set('key', value)
const value = kv.get('key')