resolve todos in core

This commit is contained in:
2025-12-20 11:02:15 +01:00
parent 7bbad511e2
commit a87cf27fb9
10 changed files with 396 additions and 199 deletions

View File

@@ -11,6 +11,8 @@ import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
import { EntityMappers } from '@core/racing/application/mappers/EntityMappers';
// TODO EntityMapper is legacy. Must use ´useServices` hook.
// Hook to detect sponsor mode
function useSponsorMode(): boolean {
const [isSponsor, setIsSponsor] = useState(false);
@@ -81,20 +83,12 @@ function SponsorSummaryPill({
}
export default function UserPill() {
const { session, login } = useAuth();
const { session } = useAuth();
const [driver, setDriver] = useState<DriverDTO | null>(null);
const [isMenuOpen, setIsMenuOpen] = useState(false);
const isSponsorMode = useSponsorMode();
const shouldReduceMotion = useReducedMotion();
const user = session?.user as
| {
id: string;
displayName?: string;
primaryDriverId?: string | null;
avatarUrl?: string | null;
}
| undefined;
const primaryDriverId = useEffectiveDriverId();