import React, {useState, useEffect} from "react"; // import { useDispatch } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; // import { customerSlice } from "./../../store"; import { AuthService, ResourceService } from "../../services"; import { Spinner, Breadcrumb, BreadcrumbItem, Tabs, Tab } from "react-bootstrap"; import { Download, Pencil, Archive } from "react-bootstrap-icons"; const ViewResource = () => { const navigate = useNavigate(); const urlParams = useParams(); const [currentResource, setCurrentResource] = useState(undefined); const params = new URLSearchParams(window.location.search); const redirectTo = () => { navigate(`/medical/resources/list`); } const goToEdit = (id) => { navigate(`/medical/resources/edit/${id}`) } const deactivateResource = (id) => { const data = { status: 'inactive' }; ResourceService.disableResource(id, data).then(() => { redirectTo(); }) } useEffect(() => { if (!AuthService.canAccessLegacySystem()) { window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.') AuthService.logout(); navigate(`/login`); } ResourceService.getResource(urlParams.id).then(resourceData => { setCurrentResource(resourceData.data); }) }, []); return ( <>
Medical Provider Information View Provider Details

View Provider Information

Basic Information
Name
{currentResource?.name}
Office Name
{currentResource?.name_original}
Branch Name
{currentResource?.name_branch}
Specialty
{currentResource?.specialty}
Type
{currentResource?.type}
Contact Information
Office Phone Number
{currentResource?.phone}
Contact
{currentResource?.contact}
Fax Number
{currentResource?.fax}
Provider Address
Address
{`${currentResource?.address}, ${currentResource?.city}, ${currentResource?.state}, ${currentResource?.zipcode}`}
Additional Information
Note
{currentResource?.note}
Description
{currentResource?.description}
Color
{currentResource?.color}
Status
{currentResource?.status}
{/* */}
); }; export default ViewResource;