chahinebrini 5c539f8937 feat(presence,sheets,chat): tester-build polish bundle
Online-Status (Phase 1+):
- UserAvatar mit 4 Size-Variants (sm/md/lg/xl) + integrierter Online-Dot
- OnlinePresenceProvider: Supabase-Channel + Following-Filter
- ChatHeaderStatus: "Online" neutral / "vor X min" offline
- useLastSeen + Heartbeat (60s interval + AppState-background ping)
- Privatsphäre-Toggle in profile/index

Sheets:
- FormSheet Android-keyboard-fix (Dimensions.get('screen'), kein
  useWindowDimensions-Kollaps), useKeyboardHandler statt manual
  Keyboard.addListener, state-reset on re-open
- PostCommentsSheet same Pattern + close-after-submit + drag bis under
  app-header
- ConnectMailSheet form-view refactor: scrollable, AES-Banner als
  footnote, field-order email→pw→label, fixed 0.85 über alle Steps

Chat:
- DmChatBackground iOS klecks fix (G transform statt nested Svg)
- ChatInput Lyra-1:1 (keyboardWillShow, surfaceElevated bubble,
  arrow-up send, attachment links)
- dm/room/chat headers + conversation-list nutzen UserAvatar
- Foreign-Profile "Nachricht"-Button öffnet richtige DM

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 08:06:47 +02:00

20 lines
569 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import { apiFetch } from '../lib/api';
type LastSeenMap = Record<string, string | null>;
export function useLastSeenBatch(userIds: string[]): LastSeenMap {
const sorted = [...userIds].sort();
const joinedKey = sorted.join(',');
const { data } = useQuery<LastSeenMap>({
queryKey: ['last-seen', joinedKey],
queryFn: () =>
apiFetch<LastSeenMap>(`/api/presence/last-seen?userIds=${encodeURIComponent(joinedKey)}`),
enabled: sorted.length > 0,
staleTime: 30_000,
});
return data ?? {};
}