import useApiFetchLocations from "../../api/useApiFetchLocations"

const useGetMosques = () => {
    const locationsResponse = useApiFetchLocations()

    const mosques = locationsResponse?.data?.filter((location: any) => location.type === "mosque")

    return {
        mosques,
        isLoading: locationsResponse.isLoading,
        error: locationsResponse.error,
        manualRefetch: locationsResponse.manualRefetch
    }
}

export default useGetMosques