mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:15:31 -04:00
19 lines
423 B
TypeScript
19 lines
423 B
TypeScript
"use client";
|
|
|
|
import TimeAgo from "react-timeago";
|
|
import { makeIntlFormatter } from "react-timeago/defaultFormatter";
|
|
|
|
const intlFormatter = makeIntlFormatter({
|
|
locale: "en",
|
|
style: "long",
|
|
numeric: "auto",
|
|
});
|
|
|
|
const RelativeTime = ({ ...rest }: React.ComponentProps<typeof TimeAgo>) => (
|
|
<span suppressHydrationWarning>
|
|
<TimeAgo formatter={intlFormatter} {...rest} />
|
|
</span>
|
|
);
|
|
|
|
export { RelativeTime };
|