diff --git a/src/components/status/TechTable.tsx b/src/components/status/TechTable.tsx index 00784c9..90966fe 100755 --- a/src/components/status/TechTable.tsx +++ b/src/components/status/TechTable.tsx @@ -5,17 +5,28 @@ import { useState, useEffect, useCallback, useRef } from 'react'; import { useAuth, useTVMode } from '@/components/context'; import { getRecentUsersWithStatuses, + getSignedUrl, updateStatuses, updateUserStatus, type UserWithStatus, } from '@/lib/hooks'; -import { Drawer, DrawerTrigger, Loading } from '@/components/ui'; +import { + Avatar, + AvatarImage, + AvatarFallback, + BasedAvatarImage, + BasedAvatarFallback, + Drawer, + DrawerTrigger, + Loading +} from '@/components/ui'; import { SubmitButton } from '@/components/default'; import { toast } from 'sonner'; import { HistoryDrawer } from '@/components/status'; import type { Profile } from '@/utils/supabase'; import type { RealtimeChannel } from '@supabase/supabase-js'; import { makeConditionalClassName } from '@/lib/utils'; +import { User } from 'lucide-react'; type TechTableProps = { initialStatuses: UserWithStatus[]; @@ -47,6 +58,22 @@ export const TechTable = ({ } }, []); + const fetchAvatarUrl = useCallback(async (url: string) => { + try { + const avatarResponse = await getSignedUrl({ + bucket: 'avatars', + url, + transform: { width: 128, height: 128 }, + }); + if (!avatarResponse.success) { + throw new Error(avatarResponse.error); + } + return avatarResponse.data; + } catch (error) { + console.error('Error fetching avatar URL:', error); + } + }, []); + // Initial load useEffect(() => { const loadData = async () => { @@ -225,7 +252,7 @@ export const TechTable = ({ /> )} -
{userWithStatus.user.full_name ?? 'Unknown User'}
+{userWithStatus.avatar_url}
+