'use client';
import { usePathname } from 'next/navigation';
import { Show } from '../../00-base';
import { Heading } from '../../01-atoms';
import { HeadingWithTitleSkeleton } from './HeadingWithTitleSkeleton';
/**
 * HeadingWithTitle component for rendering a heading based on the current pathname.
 *
 * @component
 * @example
 * // Example usage of HeadingWithTitle component
 * <HeadingWithTitle pageTitles={{ '/home': 'Home', '/about': 'About Us' }} />
 *
 * @param {Object} props - The properties of the HeadingWithTitle component.
 * @param {Record<string, string>} props.pageTitles - An object mapping pathnames to their corresponding page titles.
 *
 * @returns {ReactNode} The rendered HeadingWithTitle component.
 */
export function HeadingWithTitle({ pageTitles, }) {
    const pathname = usePathname() || '/lorem/ipsum';
    const title = pageTitles[pathname] || 'Dashboard';
    return (<Show>
      <Show.When isTrue={Boolean(title)}>
        <Heading level={'h5'}>{title}</Heading>
      </Show.When>
      <Show.Else>
        <HeadingWithTitleSkeleton />
      </Show.Else>
    </Show>);
}
//# sourceMappingURL=HeadingWithTitle.jsx.map