diff --git a/web/src/components/ChatMessages.astro b/web/src/components/ChatMessages.astro index 2897a23..4f73898 100644 --- a/web/src/components/ChatMessages.astro +++ b/web/src/components/ChatMessages.astro @@ -2,7 +2,7 @@ import { cn } from '../lib/cn' import { formatDateShort } from '../lib/timeAgo' -import MyPicture from './MyPicture.astro' +import UserBadge from './UserBadge.astro' import type { Prisma } from '@prisma/client' import type { HTMLAttributes } from 'astro/types' @@ -15,6 +15,7 @@ export type ChatMessage = { select: { id: true name: true + displayName: true picture: true } }> @@ -71,18 +72,7 @@ const { messages, userId, class: className, ...htmlProps } = Astro.props )} > {!isCurrentUser && !isNextFromSameUser && ( -
- {!!message.user.picture && (
-
- {
- comment.author.picture && (
- {user.displayName} {user.name}{user.name}
- {user.displayName &&
+ {user.displayName ?? user.name}
+
+ {user.displayName &&
- {new Date(transaction.createdAt).toLocaleDateString()}
+
)
diff --git a/web/src/pages/admin/comments.astro b/web/src/pages/admin/comments.astro
index ba41076..5be7f48 100644
--- a/web/src/pages/admin/comments.astro
+++ b/web/src/pages/admin/comments.astro
@@ -1,7 +1,12 @@
---
import { z } from 'astro/zod'
+import { Icon } from 'astro-icon/components'
+import BadgeSmall from '../../components/BadgeSmall.astro'
import CommentModeration from '../../components/CommentModeration.astro'
+import MyPicture from '../../components/MyPicture.astro'
+import TimeFormatted from '../../components/TimeFormatted.astro'
+import UserBadge from '../../components/UserBadge.astro'
import {
commentStatusFilters,
commentStatusFiltersZodEnum,
@@ -36,11 +41,18 @@ const [comments = [], totalComments = 0] = await Astro.locals.banners.try(
prisma.comment.findManyAndCount({
where: statusFilter.whereClause,
include: {
- author: true,
+ author: {
+ select: {
+ name: true,
+ displayName: true,
+ picture: true,
+ },
+ },
service: {
select: {
name: true,
slug: true,
+ imageUrl: true,
},
},
parent: {
@@ -72,7 +84,7 @@ const totalPages = Math.ceil(totalComments / PAGE_SIZE)
class={cn([
'font-title rounded-md border px-3 py-1 text-sm',
params.status === filter.value
- ? filter.styles.filter
+ ? filter.classNames.filter
: 'border-zinc-700 transition-colors hover:border-green-500/50',
])}
>
@@ -98,22 +110,7 @@ const totalPages = Math.ceil(totalComments / PAGE_SIZE)
>
-
- {suggestion.user.name}
-
+