di usage in website
This commit is contained in:
@@ -7,22 +7,18 @@ import OnboardingWizard from '@/components/onboarding/OnboardingWizard';
|
||||
import { useAuth } from '@/lib/auth/AuthContext';
|
||||
|
||||
// Shared state components
|
||||
import { useDataFetching } from '@/components/shared/hooks/useDataFetching';
|
||||
import { useCurrentDriver } from '@/hooks/driver/useCurrentDriver';
|
||||
import { LoadingWrapper } from '@/components/shared/state/LoadingWrapper';
|
||||
import { useServices } from '@/lib/services/ServiceProvider';
|
||||
|
||||
|
||||
export default function OnboardingPage() {
|
||||
const router = useRouter();
|
||||
const { session } = useAuth();
|
||||
const { driverService } = useServices();
|
||||
|
||||
// Check if user is logged in
|
||||
const shouldRedirectToLogin = !session;
|
||||
|
||||
// Fetch current driver data
|
||||
const { data: driver, isLoading } = useDataFetching({
|
||||
queryKey: ['currentDriver'],
|
||||
queryFn: () => driverService.getCurrentDriver(),
|
||||
// Fetch current driver data using DI + React-Query
|
||||
const { data: driver, isLoading } = useCurrentDriver({
|
||||
enabled: !!session,
|
||||
});
|
||||
|
||||
@@ -59,4 +55,4 @@ export default function OnboardingPage() {
|
||||
<OnboardingWizard />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user