import { useDataContext } from "../../common/contexts/data_context";
import { useGet } from "../../common/hooks/useGet";
import { ActivityPlaceEntity } from "../domain/entities/activity_place_entity";

interface UseGetActivityPointProps {
    stateId: number;
    townId: number;
    activityId: number;
    placeNumber: number;
}

export const useGetActivityPoint = ({ activityId, townId, stateId, placeNumber }: UseGetActivityPointProps) => {
    const { activityRepository } = useDataContext();
    const callback = () => {
        return activityRepository!.getPlaceActivity(activityId, townId, stateId, placeNumber);
    }
    const { data, requestStatus } = useGet<ActivityPlaceEntity>(callback);
    return { data, requestStatus };
}