--- import type { HTMLTag, Polymorphic } from "astro/types"; import type { Instructor } from "#api/instructors"; import CalendlyButton from "#components/CalendlyButton.astro"; type Props = Polymorphic<{ instructor: Instructor; as: Tag; HeadingLevel?: HTMLTag; }>; const { instructor, as: Tag = "div", class: className, HeadingLevel = "h3", ...props } = Astro.props; const firstName = instructor.name.split(" ").shift(); --- { instructor.image && (
{`${instructor.name}'s
) }
{instructor.name} {instructor.bio &&

{instructor.bio}

}
{ instructor.calendarButton && ( {instructor.calendarButton.label || `Book with ${firstName}`} ) }