import { useDataContext } from "../contexts/data_context";
import { ActivityInfoEntity } from "../domain/entities/activity_info_entity";
import { useGet } from "./useGet";

export const useGetActivityInfo = (activityId: number) => {
    const { statesRepository } = useDataContext();
    const callback = async () =>{
        return await statesRepository!.getActivityInfo(activityId) || undefined;
    }
    const { data, requestStatus } = useGet<ActivityInfoEntity | undefined>(callback);
    return { activityInfo: data, requestStatus };
}