el.xwx.moe/components/LinkViews/LinkComponents/LinkDate.tsx

24 lines
560 B
TypeScript
Raw Normal View History

2023-12-15 21:25:39 -06:00
import { LinkIncludingShortenedCollectionAndTags } from "@/types/global";
2023-12-17 02:30:09 -06:00
import React from "react";
2023-12-15 21:25:39 -06:00
2023-12-29 11:21:22 -06:00
export default function LinkDate({
link,
}: {
2023-12-15 21:25:39 -06:00
link: LinkIncludingShortenedCollectionAndTags;
}) {
2024-03-27 02:20:00 -05:00
const formattedDate = new Date(
(link.importDate || link.createdAt) as string
).toLocaleString("en-US", {
year: "numeric",
month: "short",
day: "numeric",
});
2023-12-15 21:25:39 -06:00
return (
2024-04-27 11:23:33 -05:00
<div className="flex items-center gap-1 text-neutral min-w-fit">
2023-12-17 02:30:09 -06:00
<i className="bi-calendar3 text-lg"></i>
2023-12-15 21:25:39 -06:00
<p>{formattedDate}</p>
</div>
);
}