import React, {useTransition} from "react"; import {Container, Col, Row, Image, Nav, Tab} from "react-bootstrap"; import {useState} from "react"; import {FaTaxi, FaHotel} from "react-icons/fa"; import {MdRestaurant} from "react-icons/md"; import AddNew from "./AddNew"; import ResourceListing from "./ResourceListing"; import {Link} from "react-router-dom"; import useGet from "../Hooks/useGet"; function ResourcesTab(props) { const [activeTab, setActiveTab] = useState(props.tab); const userId = JSON.parse(localStorage.getItem("user")).userId; const {data, setData, isLoading, getData, setChanged} = useGet(`${props.tab}/user/${userId}`); const handleSelect = (eventKey) => { setActiveTab(eventKey); props.refresh(eventKey); }; return ( {props.tab == "/hotel" && !isLoading && data != null && data.map((hotel) => { return ( // // ); })} {props.tab == "/restaurant" && !isLoading && data != null && data.map((restaurant) => { return ( ); })} {props.tab == "/transport" && !isLoading && data.length > 0 && data.map((transport) => { return ( ); })} ); } export default ResourcesTab;