export default function Session() {
const params = useParams<{ id: string }>();
const queryClient = useQueryClient();
const sessionId = () => params.id;
const { session, nextQuestion, clearQuestion, endSession, rateSession } =
useSession(sessionId);
onMount(() => {
console.log("{DEBUG}", "Mount Session page");
console.log("{DEBUG}", "Initial data value", session.data);
});
createEffect(() => {
console.log("{DEBUG}", "UPDATED SESSION DATA", session.data);
});
return (
<AppPageContainer>
<Show when={session.data}>
{(sessionData) => {
console.log(" ======== Executing show callback with ", sessionData());
return (
<>
<FeedbackModal
open={
Boolean(sessionData().doneAt) &&
!sessionData().ratingSubmitted
}
sessionId={sessionData().id}
// onDismiss={() => rateSession.mutate(null)}
// onSubmit={(data) => rateSession.mutateAsync(data)}
// isSubmitting={rateSession.isPending}
// isSuccess={rateSession.isSuccess}
/>
</>
);
}}
</Show>
</AppPageContainer>
);
}