feat(admin-dashboard): link top content lists
This commit is contained in:
@@ -1023,7 +1023,13 @@ function TopEventsCard({ group }: { group: EventAnalyticsSchema["top_events"] })
|
||||
<CardContent className="space-y-3 p-4 pt-0 sm:p-6 sm:pt-0">
|
||||
{group.top_items.length ? (
|
||||
group.top_items.map((event, index) => (
|
||||
<div key={event.id} className="flex items-center justify-between gap-3 rounded-xl border bg-background/70 p-3">
|
||||
<a
|
||||
key={event.id}
|
||||
href={`/events/${event.slug}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-between gap-3 rounded-xl border bg-background/70 p-3 transition hover:border-primary/50 hover:bg-muted/40"
|
||||
>
|
||||
<div className="min-w-0 text-right">
|
||||
<p className="truncate font-medium">{event.title}</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
@@ -1033,7 +1039,7 @@ function TopEventsCard({ group }: { group: EventAnalyticsSchema["top_events"] })
|
||||
</p>
|
||||
</div>
|
||||
<Badge variant="secondary">{toPersianDigits(index + 1)}</Badge>
|
||||
</div>
|
||||
</a>
|
||||
))
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">دادهای وجود ندارد.</p>
|
||||
@@ -1058,7 +1064,13 @@ function TopPostsCard({ posts }: { posts: BlogAnalyticsSchema["top_posts"] }) {
|
||||
<CardContent className="space-y-3 p-4 pt-0 sm:p-6 sm:pt-0">
|
||||
{posts.length ? (
|
||||
posts.map((post, index) => (
|
||||
<div key={post.id} className="flex items-center justify-between gap-3 rounded-xl border bg-background/70 p-3">
|
||||
<a
|
||||
key={post.id}
|
||||
href={`/blog/${post.slug}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-between gap-3 rounded-xl border bg-background/70 p-3 transition hover:border-primary/50 hover:bg-muted/40"
|
||||
>
|
||||
<div className="min-w-0 text-right">
|
||||
<p className="truncate font-medium">{post.title}</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
@@ -1066,7 +1078,7 @@ function TopPostsCard({ posts }: { posts: BlogAnalyticsSchema["top_posts"] }) {
|
||||
{formatNumberPersian(post.comments)} کامنت
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
))
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">دادهای وجود ندارد.</p>
|
||||
|
||||
Reference in New Issue
Block a user