import clsx from 'clsx'; const getFormattedPlaceFromNumber = (place: number) => { if (place % 10 === 1) return `${place}st`; if (place % 10 === 2) return `${place}nd`; if (place % 10 === 3) return `${place}rd`; return `${place}th`; }; /** * Shows a Product Hunt award. * * Use this to show a Product Hunt award, if applicable, to increase trust. */ export const LandingProductHuntAward = ({ innerClassName, className, place = 1, subtitle, title = 'Product of the Day', size = 'default', grayscale = true, textContainerClassName, titleClassName, placeClassName, }: { innerClassName?: string; className?: string; place?: number | string; subtitle?: string; title?: string; size?: 'default' | 'small'; grayscale?: boolean; textContainerClassName?: string; titleClassName?: string; placeClassName?: string; }) => { const placeIsNumber = typeof place === 'number'; const formattedPlace = placeIsNumber ? getFormattedPlaceFromNumber(place) : place; return (
3) ? 'text-[#4B587C]' : '', )} >
{title} {subtitle || formattedPlace}
); };