Make avatar imager resilient with upstream fallback everywhere
This commit is contained in:
1 parent
1bbd809b43
commit
1df1ffc3e9
13 files changed
+277
-210
No files matched your search
@@ -7,7 +7,7 @@ import { DataTable } from "@/components/admin/data-table";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
import { getAvatarUrl } from "@/lib/imager";
|
||||
import { avatarImageOnError, getAvatarUrl } from "@/lib/imager";
|
||||
import type { DataTableColumn, PaginatedResult } from "@/types/common";
|
||||
|
||||
interface OnlineUserRow {
|
||||
@@ -28,6 +28,7 @@ const columns: DataTableColumn<OnlineUserRow>[] = [
|
||||
<img
|
||||
src={getAvatarUrl(row.look, { size: "s", headOnly: true })}
|
||||
alt=""
|
||||
onError={avatarImageOnError}
|
||||
className="h-8 w-8 rounded"
|
||||
/>
|
||||
<span className="font-medium">{row.username}</span>
|
||||
@@ -51,7 +52,12 @@ const columns: DataTableColumn<OnlineUserRow>[] = [
|
||||
key: "look",
|
||||
label: "Avatar",
|
||||
render: (_, row) => (
|
||||
<img src={getAvatarUrl(row.look)} alt={row.username} className="h-16" />
|
||||
<img
|
||||
src={getAvatarUrl(row.look)}
|
||||
alt={row.username}
|
||||
onError={avatarImageOnError}
|
||||
className="h-16"
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user