"use client";

import {useParams} from "next/navigation";
import {useMemo} from "react";

export default function useSession() {
    const params = useParams();
    const selectedSessionChatId = useMemo(() => {
        return params?.sessionChatId || ("" as string)
    }, [params?.sessionChatId])

    const isSessionChatOpened = useMemo(() => {
        return !!selectedSessionChatId
    }, [selectedSessionChatId])

    return {
        selectedSessionChatId,
        isSessionChatOpened
    }
}