Function
CommitTimestamp
({
date,
className,
children,
...props
}: CommitTimestampProps)
Source from the content-addressed store, hash-verified
| 152 | }); |
| 153 | |
| 154 | export const CommitTimestamp = ({ |
| 155 | date, |
| 156 | className, |
| 157 | children, |
| 158 | ...props |
| 159 | }: CommitTimestampProps) => { |
| 160 | const formatted = relativeTimeFormat.format( |
| 161 | Math.round((date.getTime() - Date.now()) / (1000 * 60 * 60 * 24)), |
| 162 | "day" |
| 163 | ); |
| 164 | |
| 165 | return ( |
| 166 | <time |
| 167 | className={cn("text-xs", className)} |
| 168 | dateTime={date.toISOString()} |
| 169 | {...props} |
| 170 | > |
| 171 | {children ?? formatted} |
| 172 | </time> |
| 173 | ); |
| 174 | }; |
| 175 | |
| 176 | export type CommitActionsProps = HTMLAttributes<HTMLDivElement>; |
| 177 | |
Callers
nothing calls this directly
Tested by
no test coverage detected