mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-25 18:13:48 -04:00
* Test * Add pretty formatting * Fix Tests * Fix Tests * Fix Tests * Fix * Add pretty formatting fix * Fix * Test * Fix tests * Clean typeckech * Add prettier check * Fix api tsconfig * Fix api tsconfig * Fix tsconfig * Fix * Fix * Prettier
18 lines
498 B
TypeScript
18 lines
498 B
TypeScript
import clsx from 'clsx'
|
|
import {DAY_MS} from 'common/util/time'
|
|
|
|
export function NewBadge(props: {classes: string | undefined; created?: string; days?: number}) {
|
|
const {classes, created, days = 30} = props
|
|
if (created && Date.now() - new Date(created).getTime() > days * DAY_MS) return null
|
|
return (
|
|
<span
|
|
className={clsx(
|
|
'absolute z-10 rounded px-1 text-xs text-primary-500 font-semibold tracking-wide shadow',
|
|
classes,
|
|
)}
|
|
>
|
|
new
|
|
</span>
|
|
)
|
|
}
|