import { Helmet } from 'react-helmet-async' import Skeleton from 'react-loading-skeleton' import IVButton, { IVButtonProps } from '~/components/IVButton' import ActionsBreadcrumbs from '../ActionBreadcrumbs' import IVConstraintsIndicator from '~/components/IVConstraintsIndicator' export interface PageHeadingProps { title?: React.ReactNode | null subtitle?: string description?: React.ReactNode actions?: IVButtonProps[] showBackButton?: boolean breadcrumbs?: { name: string; slug: string }[] children?: React.ReactNode titleError?: React.ReactNode descriptionError?: React.ReactNode } export default function PageHeading({ title, subtitle, description, actions, breadcrumbs, children, titleError, descriptionError, }: PageHeadingProps) { const textTitle = typeof title === 'string' ? title : 'Loading...' return (
{textTitle} | Interval
{breadcrumbs && breadcrumbs.length > 0 && (
)}

{title ?? } {subtitle && ( {subtitle} )}

{titleError && (
)}
{descriptionError ? (

Error loading description

) : ( description && (

{description}

) )}
{children ? (
{children}
) : (
{actions?.map((props, i) => ( ))}
)}
) }