"use client";
import { useAuth } from "react-oidc-context";
import { api, getUser, Session } from "muzak/data/fetcher";
import { useSession } from "muzak/contexts/SessionContext";

export default async function getSessionId() {
  //const auth = useAuth();
  //const { sessionId, setSessionId } = useSession();

  //if (!auth.isLoading && !auth.error && auth.isAuthenticated) {
  const { data: sessions } = await api?.sessions?.list({});
  if (sessions?.length > 0) {
    return sessions[0].session_id;
  }
  //}
}
