import React, { ReactElement } from 'react' import { IconBooks } from '@tabler/icons-react' import LifecyclePicture from '@/components/fit-standards/LifecyclePicture' type HeaderOptions = { title: string description: string img?: { src: string alt?: string } status: string children?: ReactElement[] } export default ({ title, description, img, status, children }: HeaderOptions) => { return ( <section className="bg-white mt-10 w-full mx-auto relative z-10 lg:pb-32" aria-labelledby="heading"> <h2 className="sr-only" id="heading"> {title} </h2> <div className="flex flex-col bg-white border-r-4"> <div className="flex-1 relative pt-4 px-6 pb-8 md:px-8"> {/* Icon + Title */} <div className="top-0 inline-block transform -translate-y-1/2"> <header className={'flex justify-between space-x-6 items-center'}> {img && img.src ? ( <img className={'h-10'} src={img.src} alt={img.alt} /> ) : ( <IconBooks className='hidden w-24 h-24'/> )} <h1 className="text-3xl lg:text-4xl tracking-tight text-gray-900 overflow-hidden"> {title} </h1> </header> </div> {/* Life cycle phase */} <div className="flex"> <LifecyclePicture status = {status} /> </div> {/* Detailed description */} <div className="flex flex-col md:flex-row md:items-center"> <div className="cms-blog-text text-xl text-gray-800 mt-5 md:flex-1" dangerouslySetInnerHTML={{ __html: description }} /> </div> </div> { (children !== undefined ? <div className="p-6 bg-gray-50 rounded-b-lg md:px-8 flex flex-row items-center gap-16"> {children} </div> : null ) } </div> </section> ) }