I am creating an alert component in nextjs with tailwindcss to display some information. Ultimately I would like to pass a a prop "alert_type" to this component and based on that change the colour of the alert. (The example below does not have this functionality yet). In the example below I would expect the colour of my alert to be green however, it is not picking up the colour specifications. I don't understand why this is not working...
export function Success({ title, children }: AlertProps) {
const colour = 'green'
return (
<div className={`rounded-md p-4 bg-${colour}-50`}>
<div className="flex">
<div className="flex-shrink-0">
<CheckCircleIcon
className={'h-5 w-5' + ' text-' + colour + '-400'}
aria-hidden="true"
/>
</div>
<div className="ml-3">
<h3 className={'text-sm font-medium' + ' text-' + colour + '-800'}>
{title}
</h3>
<div className={'mt-2 text-sm' + ' text-' + colour + '-700'}>
{children}
</div>
</div>
</div>
</div>
)
}