import React from "react"; import dayjs from "dayjs"; import clsx from "clsx"; import type { FeedSection } from "@refinedev/devtools-shared"; type Props = { item: FeedSection; }; export const FeedItem = ({ item }: Props) => { const isNew = dayjs().diff(dayjs(item.date), "day") <= 3; const isFeatured = item.featured; return (
{item.avatar && ( )}
{item.author}
ยท
{dayjs(item.date).format("DD MMM, HH:mm")}
{isFeatured ? "featured" : isNew ? "new" : ""}
{item.cover && ( )}
{item.title}
); };