import React, { ReactElement, useEffect } from 'react';
import Head from 'next/head'
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import dayjs from "dayjs";
import {useAppDispatch, useAppSelector} from "../../stores/hooks";
import {useRouter} from "next/router";
import { fetch } from '../../stores/organizations/organizationsSlice'
import {saveFile} from "../../helpers/fileSaver";
import dataFormatter from '../../helpers/dataFormatter';
import ImageField from "../../components/ImageField";
import LayoutAuthenticated from "../../layouts/Authenticated";
import {getPageTitle} from "../../config";
import SectionTitleLineWithButton from "../../components/SectionTitleLineWithButton";
import SectionMain from "../../components/SectionMain";
import CardBox from "../../components/CardBox";
import BaseButton from "../../components/BaseButton";
import BaseDivider from "../../components/BaseDivider";
import {mdiChartTimelineVariant} from "@mdi/js";
import {SwitchField} from "../../components/SwitchField";
import FormField from "../../components/FormField";

import {hasPermission} from "../../helpers/userPermissions";


const OrganizationsView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { organizations } = useAppSelector((state) => state.organizations)
    
    const { currentUser } = useAppSelector((state) => state.auth);
    

    const { id } = router.query;
    
    function removeLastCharacter(str) {
      console.log(str,`str`)
      return str.slice(0, -1);
    }

    useEffect(() => {
        dispatch(fetch({ id }));
    }, [dispatch, id]);


    return (
      <>
          <Head>
              <title>{getPageTitle('View organizations')}</title>
          </Head>
          <SectionMain>
            <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title={removeLastCharacter('View organizations')} main>
                <BaseButton
                  color='info'
                  label='Edit'
                  href={`/organizations/organizations-edit/?id=${id}`}
                />
            </SectionTitleLineWithButton>
            <CardBox>
            

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Name</p>
                    <p>{organizations?.name}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

                
                <>
                    <p className={'block font-bold mb-2'}>Users Organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>First Name</th>
                                
                                
                                
                                <th>Last Name</th>
                                
                                
                                
                                <th>Phone Number</th>
                                
                                
                                
                                <th>E-Mail</th>
                                
                                
                                
                                <th>Disabled</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.users_organizations && Array.isArray(organizations.users_organizations) &&
                              organizations.users_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/users/users-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="firstName">
                                        { item.firstName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lastName">
                                        { item.lastName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phoneNumber">
                                        { item.phoneNumber }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="disabled">
                                        { dataFormatter.booleanFormatter(item.disabled) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.users_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Locations Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>Market</th>
                                
                                
                                
                                <th>Timezone</th>
                                
                                
                                
                                <th>AddressLine1</th>
                                
                                
                                
                                <th>City</th>
                                
                                
                                
                                <th>State</th>
                                
                                
                                
                                <th>PostalCode</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.locations_organization && Array.isArray(organizations.locations_organization) &&
                              organizations.locations_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/locations/locations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="market">
                                        { item.market }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="timezone">
                                        { item.timezone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="address_line_1">
                                        { item.address_line_1 }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="city">
                                        { item.city }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="state">
                                        { item.state }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="postal_code">
                                        { item.postal_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.locations_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Role_assignments Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>RoleName</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>ScopeNotes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.role_assignments_organization && Array.isArray(organizations.role_assignments_organization) &&
                              organizations.role_assignments_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/role_assignments/role_assignments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="role_name">
                                        { item.role_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scope_notes">
                                        { item.scope_notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.role_assignments_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Payers organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>PayerType</th>
                                
                                
                                
                                <th>Phone</th>
                                
                                
                                
                                <th>WebsiteURL</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.payers_organizations && Array.isArray(organizations.payers_organizations) &&
                              organizations.payers_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/payers/payers-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="payer_type">
                                        { item.payer_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phone">
                                        { item.phone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="website_url">
                                        { item.website_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.payers_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Payer_plans organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>PlanCode</th>
                                
                                
                                
                                <th>NetworkType</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.payer_plans_organizations && Array.isArray(organizations.payer_plans_organizations) &&
                              organizations.payer_plans_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/payer_plans/payer_plans-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="plan_code">
                                        { item.plan_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="network_type">
                                        { item.network_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.payer_plans_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Procedure_families organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>Modality</th>
                                
                                
                                
                                <th>BodyRegion</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.procedure_families_organizations && Array.isArray(organizations.procedure_families_organizations) &&
                              organizations.procedure_families_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/procedure_families/procedure_families-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="modality">
                                        { item.modality }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="body_region">
                                        { item.body_region }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.procedure_families_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Cpt_codes organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CPTCode</th>
                                
                                
                                
                                <th>ShortDescription</th>
                                
                                
                                
                                <th>LongDescription</th>
                                
                                
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.cpt_codes_organizations && Array.isArray(organizations.cpt_codes_organizations) &&
                              organizations.cpt_codes_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/cpt_codes/cpt_codes-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="code">
                                        { item.code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="short_description">
                                        { item.short_description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="long_description">
                                        { item.long_description }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.cpt_codes_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Patients Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>FirstName</th>
                                
                                
                                
                                <th>LastName</th>
                                
                                
                                
                                <th>DateOfBirth</th>
                                
                                
                                
                                <th>Sex</th>
                                
                                
                                
                                <th>MRN</th>
                                
                                
                                
                                <th>Phone</th>
                                
                                
                                
                                <th>Email</th>
                                
                                
                                
                                <th>AddressLine1</th>
                                
                                
                                
                                <th>City</th>
                                
                                
                                
                                <th>State</th>
                                
                                
                                
                                <th>PostalCode</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.patients_organization && Array.isArray(organizations.patients_organization) &&
                              organizations.patients_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/patients/patients-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="first_name">
                                        { item.first_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_name">
                                        { item.last_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="date_of_birth">
                                        { dataFormatter.dateTimeFormatter(item.date_of_birth) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sex">
                                        { item.sex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="mrn">
                                        { item.mrn }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phone">
                                        { item.phone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="address_line_1">
                                        { item.address_line_1 }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="city">
                                        { item.city }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="state">
                                        { item.state }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="postal_code">
                                        { item.postal_code }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.patients_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Authorization_cases Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Stage</th>
                                
                                
                                
                                <th>Urgency</th>
                                
                                
                                
                                <th>OrderingProviderName</th>
                                
                                
                                
                                <th>RenderingProviderName</th>
                                
                                
                                
                                <th>SiteOfService</th>
                                
                                
                                
                                <th>ScheduledDate</th>
                                
                                
                                
                                <th>DollarsAtRisk</th>
                                
                                
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>SLAState</th>
                                
                                
                                
                                <th>InternalNotes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.authorization_cases_organization && Array.isArray(organizations.authorization_cases_organization) &&
                              organizations.authorization_cases_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/authorization_cases/authorization_cases-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="stage">
                                        { item.stage }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="urgency">
                                        { item.urgency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ordering_provider_name">
                                        { item.ordering_provider_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rendering_provider_name">
                                        { item.rendering_provider_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="site_of_service">
                                        { item.site_of_service }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_date">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_date) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="dollars_at_risk">
                                        { item.dollars_at_risk }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sla_state">
                                        { item.sla_state }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="internal_notes">
                                        { item.internal_notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.authorization_cases_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Case_documents organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>DocumentType</th>
                                
                                
                                
                                <th>SourceChannel</th>
                                
                                
                                
                                <th>StorageKey</th>
                                
                                
                                
                                <th>OriginalFilename</th>
                                
                                
                                
                                <th>Checksum</th>
                                
                                
                                
                                
                                
                                <th>UploadedAt</th>
                                
                                
                                
                                <th>VersionNumber</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.case_documents_organizations && Array.isArray(organizations.case_documents_organizations) &&
                              organizations.case_documents_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/case_documents/case_documents-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="document_type">
                                        { item.document_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="source_channel">
                                        { item.source_channel }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="storage_key">
                                        { item.storage_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="original_filename">
                                        { item.original_filename }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="checksum">
                                        { item.checksum }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="uploaded_at">
                                        { dataFormatter.dateTimeFormatter(item.uploaded_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="version_number">
                                        { item.version_number }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.case_documents_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Submissions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>SubmissionChannel</th>
                                
                                
                                
                                <th>ReferenceNumber</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>DecisionAt</th>
                                
                                
                                
                                <th>DecisionType</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.submissions_organizations && Array.isArray(organizations.submissions_organizations) &&
                              organizations.submissions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/submissions/submissions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="submission_channel">
                                        { item.submission_channel }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reference_number">
                                        { item.reference_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.submitted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="decision_at">
                                        { dataFormatter.dateTimeFormatter(item.decision_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="decision_type">
                                        { item.decision_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.submissions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Submission_events organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>EventType</th>
                                
                                
                                
                                <th>EventAt</th>
                                
                                
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.submission_events_organizations && Array.isArray(organizations.submission_events_organizations) &&
                              organizations.submission_events_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/submission_events/submission_events-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="event_type">
                                        { item.event_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="event_at">
                                        { dataFormatter.dateTimeFormatter(item.event_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.submission_events_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Tasks Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>TaskType</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>Priority</th>
                                
                                
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.tasks_organization && Array.isArray(organizations.tasks_organization) &&
                              organizations.tasks_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/tasks/tasks-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="task_type">
                                        { item.task_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="priority">
                                        { item.priority }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.tasks_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Denials Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>DenialAt</th>
                                
                                
                                
                                <th>DenialType</th>
                                
                                
                                
                                <th>DenialReasonText</th>
                                
                                
                                
                                <th>DenialCode</th>
                                
                                
                                
                                <th>DollarsDenied</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.denials_organization && Array.isArray(organizations.denials_organization) &&
                              organizations.denials_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/denials/denials-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="denial_at">
                                        { dataFormatter.dateTimeFormatter(item.denial_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="denial_type">
                                        { item.denial_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="denial_reason_text">
                                        { item.denial_reason_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="denial_code">
                                        { item.denial_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="dollars_denied">
                                        { item.dollars_denied }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.denials_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Appeals Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>AppealLevel</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                                
                                <th>DecisionAt</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>ReviewedAt</th>
                                
                                
                                
                                
                                
                                <th>ExportArtifactKey</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.appeals_organization && Array.isArray(organizations.appeals_organization) &&
                              organizations.appeals_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/appeals/appeals-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="appeal_level">
                                        { item.appeal_level }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.submitted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="decision_at">
                                        { dataFormatter.dateTimeFormatter(item.decision_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reviewed_at">
                                        { dataFormatter.dateTimeFormatter(item.reviewed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="export_artifact_key">
                                        { item.export_artifact_key }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.appeals_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Templates Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TemplateType</th>
                                
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>VersionLabel</th>
                                
                                
                                
                                <th>VersionStatus</th>
                                
                                
                                
                                
                                
                                <th>EffectiveFrom</th>
                                
                                
                                
                                <th>EffectiveTo</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.templates_organization && Array.isArray(organizations.templates_organization) &&
                              organizations.templates_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/templates/templates-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="template_type">
                                        { item.template_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="version_label">
                                        { item.version_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="version_status">
                                        { item.version_status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="effective_from">
                                        { dataFormatter.dateTimeFormatter(item.effective_from) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_to">
                                        { dataFormatter.dateTimeFormatter(item.effective_to) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.templates_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Payer_rules Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>VersionLabel</th>
                                
                                
                                
                                <th>VersionStatus</th>
                                
                                
                                
                                <th>EffectiveFrom</th>
                                
                                
                                
                                <th>EffectiveTo</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.payer_rules_organization && Array.isArray(organizations.payer_rules_organization) &&
                              organizations.payer_rules_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/payer_rules/payer_rules-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="version_label">
                                        { item.version_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="version_status">
                                        { item.version_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_from">
                                        { dataFormatter.dateTimeFormatter(item.effective_from) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_to">
                                        { dataFormatter.dateTimeFormatter(item.effective_to) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.payer_rules_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Rule_requirements organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>RequirementType</th>
                                
                                
                                
                                <th>RequirementLabel</th>
                                
                                
                                
                                <th>EvidenceNeeded</th>
                                
                                
                                
                                <th>Severity</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.rule_requirements_organizations && Array.isArray(organizations.rule_requirements_organizations) &&
                              organizations.rule_requirements_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/rule_requirements/rule_requirements-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="requirement_type">
                                        { item.requirement_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="requirement_label">
                                        { item.requirement_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="evidence_needed">
                                        { item.evidence_needed }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="severity">
                                        { item.severity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.rule_requirements_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Ai_jobs Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>JobType</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>PromptText</th>
                                
                                
                                
                                <th>ModelRef</th>
                                
                                
                                
                                <th>InputJSON</th>
                                
                                
                                
                                <th>QueuedAt</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>FinishedAt</th>
                                
                                
                                
                                <th>ErrorMessage</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.ai_jobs_organization && Array.isArray(organizations.ai_jobs_organization) &&
                              organizations.ai_jobs_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/ai_jobs/ai_jobs-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="job_type">
                                        { item.job_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="prompt_text">
                                        { item.prompt_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="model_ref">
                                        { item.model_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="input_json">
                                        { item.input_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="queued_at">
                                        { dataFormatter.dateTimeFormatter(item.queued_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="finished_at">
                                        { dataFormatter.dateTimeFormatter(item.finished_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="error_message">
                                        { item.error_message }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.ai_jobs_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Ai_outputs organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>OutputType</th>
                                
                                
                                
                                <th>OutputJSON</th>
                                
                                
                                
                                <th>ConfidenceScore</th>
                                
                                
                                
                                <th>CitationsJSON</th>
                                
                                
                                
                                <th>ModelRef</th>
                                
                                
                                
                                <th>PromptText</th>
                                
                                
                                
                                <th>GeneratedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.ai_outputs_organizations && Array.isArray(organizations.ai_outputs_organizations) &&
                              organizations.ai_outputs_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/ai_outputs/ai_outputs-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="output_type">
                                        { item.output_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="output_json">
                                        { item.output_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="confidence_score">
                                        { item.confidence_score }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="citations_json">
                                        { item.citations_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="model_ref">
                                        { item.model_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="prompt_text">
                                        { item.prompt_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="generated_at">
                                        { dataFormatter.dateTimeFormatter(item.generated_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.ai_outputs_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Review_actions Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>ActionType</th>
                                
                                
                                
                                <th>CorrectionJSON</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                <th>ActionAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.review_actions_organization && Array.isArray(organizations.review_actions_organization) &&
                              organizations.review_actions_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/review_actions/review_actions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="action_type">
                                        { item.action_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="correction_json">
                                        { item.correction_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="action_at">
                                        { dataFormatter.dateTimeFormatter(item.action_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.review_actions_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Audit_logs Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>ActionType</th>
                                
                                
                                
                                <th>EntityName</th>
                                
                                
                                
                                <th>EntityKey</th>
                                
                                
                                
                                <th>ChangesJSON</th>
                                
                                
                                
                                <th>IPAddress</th>
                                
                                
                                
                                <th>UserAgent</th>
                                
                                
                                
                                <th>OccurredAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.audit_logs_organization && Array.isArray(organizations.audit_logs_organization) &&
                              organizations.audit_logs_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/audit_logs/audit_logs-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="action_type">
                                        { item.action_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="entity_name">
                                        { item.entity_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="entity_key">
                                        { item.entity_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="changes_json">
                                        { item.changes_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ip_address">
                                        { item.ip_address }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="user_agent">
                                        { item.user_agent }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="occurred_at">
                                        { dataFormatter.dateTimeFormatter(item.occurred_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.audit_logs_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Integration_endpoints Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>IntegrationType</th>
                                
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>BaseURL</th>
                                
                                
                                
                                <th>AuthType</th>
                                
                                
                                
                                <th>ConfigJSON</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>LastSuccessAt</th>
                                
                                
                                
                                <th>LastFailureAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.integration_endpoints_organization && Array.isArray(organizations.integration_endpoints_organization) &&
                              organizations.integration_endpoints_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/integration_endpoints/integration_endpoints-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="integration_type">
                                        { item.integration_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="base_url">
                                        { item.base_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="auth_type">
                                        { item.auth_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="config_json">
                                        { item.config_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_success_at">
                                        { dataFormatter.dateTimeFormatter(item.last_success_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_failure_at">
                                        { dataFormatter.dateTimeFormatter(item.last_failure_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.integration_endpoints_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Contacts Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>ContactType</th>
                                
                                
                                
                                <th>Name</th>
                                
                                
                                
                                <th>RoleTitle</th>
                                
                                
                                
                                <th>Phone</th>
                                
                                
                                
                                <th>Email</th>
                                
                                
                                
                                <th>Fax</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.contacts_organization && Array.isArray(organizations.contacts_organization) &&
                              organizations.contacts_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/contacts/contacts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="contact_type">
                                        { item.contact_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="role_title">
                                        { item.role_title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phone">
                                        { item.phone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="fax">
                                        { item.fax }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.contacts_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

                <BaseButton
                    color='info'
                    label='Back'
                    onClick={() => router.push('/organizations/organizations-list')}
                />
              </CardBox>
          </SectionMain>
      </>
    );
};

OrganizationsView.getLayout = function getLayout(page: ReactElement) {
    return (
      <LayoutAuthenticated
        
        permission={'READ_ORGANIZATIONS'}
        
      >
          {page}
      </LayoutAuthenticated>
    )
}

export default OrganizationsView;