Function
DateTooltip
({ date, children, className }: Props)
Source from the content-addressed store, hash-verified
| 14 | } |
| 15 | |
| 16 | export const DateTooltip = ({ date, children, className }: Props) => { |
| 17 | return ( |
| 18 | <TooltipProvider delayDuration={0}> |
| 19 | <Tooltip> |
| 20 | <TooltipTrigger> |
| 21 | <span |
| 22 | className={cn( |
| 23 | "flex items-center text-muted-foreground text-left", |
| 24 | className, |
| 25 | )} |
| 26 | > |
| 27 | {children}{" "} |
| 28 | {formatDistanceToNow(new Date(date), { |
| 29 | addSuffix: true, |
| 30 | })} |
| 31 | </span> |
| 32 | </TooltipTrigger> |
| 33 | <TooltipContent>{format(new Date(date), "PPpp")}</TooltipContent> |
| 34 | </Tooltip> |
| 35 | </TooltipProvider> |
| 36 | ); |
| 37 | }; |
Callers
nothing calls this directly
Tested by
no test coverage detected