refactor: remove ProfileIcon component and update image handling for author profiles

This commit is contained in:
Ardeman
2025-03-25 19:25:49 +08:00
parent 84451f1fd4
commit eedb155880
7 changed files with 42 additions and 48 deletions
+15 -3
View File
@@ -39,9 +39,21 @@ export const StaffsPage = () => {
]
const dataSlot: DataTableSlots = {
1: (_value: unknown, _type: unknown, data: TStaffResponse) => (
<div>
<div>{data.name}</div>
<div className="text-sm text-[#7C7C7C]">ID: {data.id.slice(0, 8)}</div>
<div className="flex items-center gap-x-2">
<img
src={data?.profile_picture || '/images/profile-placeholder.svg'}
onError={(event) => {
event.currentTarget.src = '/images/profile-placeholder.svg'
}}
alt={data?.name}
className="size-8 rounded-full bg-[#C4C4C4] object-cover"
/>
<div>
<div>{data.name}</div>
<div className="text-xs text-[#7C7C7C]">
ID: {data.id.slice(0, 8)}
</div>
</div>
</div>
),
}