From c9740eb2f61b8f9578d011b4b3a5d5182603f05d Mon Sep 17 00:00:00 2001 From: DaniiRix Date: Sat, 18 Oct 2025 14:14:35 +0530 Subject: [PATCH] minor changes --- .../ProDashboard/components/DashboardCard.tsx | 68 +++++++++++-------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/src/containers/ProDashboard/components/DashboardCard.tsx b/src/containers/ProDashboard/components/DashboardCard.tsx index 22dc7bc116..d4dcb4d200 100644 --- a/src/containers/ProDashboard/components/DashboardCard.tsx +++ b/src/containers/ProDashboard/components/DashboardCard.tsx @@ -1,4 +1,6 @@ import { useMemo, useState } from 'react' +import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' import { Icon } from '~/components/Icon' import { BasicLink } from '~/components/Link' import { LoadingSpinner } from '~/components/Loaders' @@ -6,6 +8,8 @@ import { Tooltip } from '~/components/Tooltip' import { Dashboard } from '../services/DashboardAPI' import { DashboardItemConfig } from '../types' +dayjs.extend(relativeTime) + interface DashboardCardProps { dashboard: Dashboard onTagClick?: (tag: string) => void @@ -68,6 +72,8 @@ export function DashboardCard({ dashboard, onTagClick, onDelete, viewMode = 'gri return summary }, [dashboard.data.items]) + console.log({ dashboard }) + return (
} - {dashboard.description ? ( -

{dashboard.description}

+

{dashboard.description}

) : null} {dashboard.data.items?.length ? ( @@ -119,34 +123,36 @@ export function DashboardCard({ dashboard, onTagClick, onDelete, viewMode = 'gri
) : null} -
-
-

- - Views - {dashboard.viewCount || 0} -

-

- - Favorites - {dashboard.likeCount || 0} +

+ {viewMode === 'grid' && } + +
+
+

+ + Views + {dashboard.viewCount || 0} +

+

+ + Favorites + {dashboard.likeCount || 0} +

+
+ +

+ + Updated {dayjs(dashboard.updated).fromNow()}

- -

- - Updated {new Date(dashboard.updated).toLocaleDateString()} -

View dashboard @@ -171,7 +177,9 @@ const Tags = ({ dashboard, onTagClick }: { dashboard: Dashboard; onTagClick?: (t {tag} ))} - {dashboard.tags.length > 2 && +{dashboard.tags.length - 2}} + {dashboard.tags.length > 2 && ( + +{dashboard.tags.length - 2} more + )}
) }