import Button from "@/components/ui/Button";
import Screen from "@/components/ui/Screen";
import { useSession } from "@/ctx";
import { router } from "expo-router";
import React from "react";

export default function ProfileScreen() {
  const { signOut } = useSession();

  const disconnect = () => {
    signOut();
    router.replace("/log-in");
  };

  const goToQuiz = () => {
    router.replace("/quiz");
  };

  return (
    <Screen className="justify-center items-center grow">
      <Button className="mb-4" onPress={goToQuiz}>
        Relancer le quiz
      </Button>
      <Button onPress={disconnect}>Se déconnecter</Button>
    </Screen>
  );
}
