Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

436 B
Raw Blame
"use client";

import useRelativeTime from "@/lib/hooks/relative-time";
import { useTranslation } from "@/lib/i18n/client";

export default function RelativeTime({ date }: { date: Date }) {
  const { i18n } = useTranslation();
  const { fromNow, localCreatedAt } = useRelativeTime(date, i18n.language);

  return (
    <time dateTime={date.toISOString()} title={localCreatedAt || undefined}>
      {fromNow || "—"}
    </time>
  );
}