import { useEffect, useState } from 'preact/hooks'; /** * Delays a boolean value change by a specified duration. * Perfect for coordinating animations with state changes. * * @param {boolean} value - The boolean value to delay * @param {number} onDelay - Milliseconds to wait before changing to true * @param {number} [offDelay] - Milliseconds to wait before changing to false (defaults to onDelay) * @returns {boolean} The delayed value * * @example * // Delay both transitions by 300ms * const isVisible = useDelayedValue(show, 300); * * @example * // Quick show (100ms), slow hide (500ms) * const isVisible = useDelayedValue(show, 100, 500); * * @example * // Use with CSS transitions * const isVisible = useDelayedValue(show, 300); * return ( *