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'}>Onboarding_responses organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Step</th>
                                
                                
                                
                                <th>LearningGoalsText</th>
                                
                                
                                
                                <th>PrimaryLearningGoal</th>
                                
                                
                                
                                <th>LinkedInConnected</th>
                                
                                
                                
                                <th>GitHubConnected</th>
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.onboarding_responses_organizations && Array.isArray(organizations.onboarding_responses_organizations) &&
                              organizations.onboarding_responses_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/onboarding_responses/onboarding_responses-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="step_name">
                                        { item.step_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="learning_goals_text">
                                        { item.learning_goals_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="learning_goal_primary">
                                        { item.learning_goal_primary }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="linkedin_connected">
                                        { dataFormatter.booleanFormatter(item.linkedin_connected) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="github_connected">
                                        { dataFormatter.booleanFormatter(item.github_connected) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.submitted_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.onboarding_responses_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>External_accounts organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Provider</th>
                                
                                
                                
                                <th>Handle</th>
                                
                                
                                
                                <th>ProfileURL</th>
                                
                                
                                
                                <th>AccessTokenHint</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>ConnectedAt</th>
                                
                                
                                
                                <th>LastSyncedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.external_accounts_organizations && Array.isArray(organizations.external_accounts_organizations) &&
                              organizations.external_accounts_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/external_accounts/external_accounts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="provider">
                                        { item.provider }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="handle">
                                        { item.handle }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="profile_url">
                                        { item.profile_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="access_token_hint">
                                        { item.access_token_hint }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="connected_at">
                                        { dataFormatter.dateTimeFormatter(item.connected_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_synced_at">
                                        { dataFormatter.dateTimeFormatter(item.last_synced_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.external_accounts_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Skill_nodes organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>SkillNodeName</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>Category</th>
                                
                                
                                
                                <th>NodeIndex</th>
                                
                                
                                
                                <th>RequiredForCertification</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.skill_nodes_organizations && Array.isArray(organizations.skill_nodes_organizations) &&
                              organizations.skill_nodes_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/skill_nodes/skill_nodes-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="category">
                                        { item.category }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="node_index">
                                        { item.node_index }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_required_for_certification">
                                        { dataFormatter.booleanFormatter(item.is_required_for_certification) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.skill_nodes_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>User_skill_node_awards organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>SourceType</th>
                                
                                
                                
                                <th>SourceLabel</th>
                                
                                
                                
                                <th>EvidenceURL</th>
                                
                                
                                
                                <th>ConfidenceScore</th>
                                
                                
                                
                                <th>AwardedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.user_skill_node_awards_organizations && Array.isArray(organizations.user_skill_node_awards_organizations) &&
                              organizations.user_skill_node_awards_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_skill_node_awards/user_skill_node_awards-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="source_type">
                                        { item.source_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="source_label">
                                        { item.source_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="evidence_url">
                                        { item.evidence_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="confidence_score">
                                        { item.confidence_score }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="awarded_at">
                                        { dataFormatter.dateTimeFormatter(item.awarded_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.user_skill_node_awards_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Projects organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ProjectName</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>ProjectURL</th>
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>AIToolsUsed</th>
                                
                                
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.projects_organizations && Array.isArray(organizations.projects_organizations) &&
                              organizations.projects_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/projects/projects-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="project_url">
                                        { item.project_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ai_tools_used">
                                        { item.ai_tools_used }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.projects_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>External_signals organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Source</th>
                                
                                
                                
                                <th>SignalType</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Summary</th>
                                
                                
                                
                                <th>SourceURL</th>
                                
                                
                                
                                <th>SignalScore</th>
                                
                                
                                
                                <th>SignalAt</th>
                                
                                
                                
                                <th>Verified</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.external_signals_organizations && Array.isArray(organizations.external_signals_organizations) &&
                              organizations.external_signals_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/external_signals/external_signals-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="source">
                                        { item.source }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="signal_type">
                                        { item.signal_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="summary">
                                        { item.summary }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="source_url">
                                        { item.source_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="signal_score">
                                        { item.signal_score }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="signal_at">
                                        { dataFormatter.dateTimeFormatter(item.signal_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_verified">
                                        { dataFormatter.booleanFormatter(item.is_verified) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.external_signals_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Courses organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CourseName</th>
                                
                                
                                
                                <th>Tagline</th>
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>HeroImageURL</th>
                                
                                
                                
                                <th>EstimatedTotalMinutes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.courses_organizations && Array.isArray(organizations.courses_organizations) &&
                              organizations.courses_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/courses/courses-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tagline">
                                        { item.tagline }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="hero_image_url">
                                        { item.hero_image_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="estimated_total_minutes">
                                        { item.estimated_total_minutes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.courses_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Course_phases organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>PhaseName</th>
                                
                                
                                
                                <th>Summary</th>
                                
                                
                                
                                <th>PhaseNumber</th>
                                
                                
                                
                                <th>EstimatedMinutes</th>
                                
                                
                                
                                <th>UnlockRule</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.course_phases_organizations && Array.isArray(organizations.course_phases_organizations) &&
                              organizations.course_phases_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/course_phases/course_phases-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="summary">
                                        { item.summary }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phase_number">
                                        { item.phase_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="estimated_minutes">
                                        { item.estimated_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="unlock_rule">
                                        { item.unlock_rule }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.course_phases_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Lessons organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>LessonName</th>
                                
                                
                                
                                <th>Summary</th>
                                
                                
                                
                                <th>LessonNumber</th>
                                
                                
                                
                                <th>EstimatedMinutes</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                <th>HasQuiz</th>
                                
                                
                                
                                <th>HasBuildTask</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.lessons_organizations && Array.isArray(organizations.lessons_organizations) &&
                              organizations.lessons_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/lessons/lessons-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="summary">
                                        { item.summary }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lesson_number">
                                        { item.lesson_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="estimated_minutes">
                                        { item.estimated_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="has_quiz">
                                        { dataFormatter.booleanFormatter(item.has_quiz) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="has_build_task">
                                        { dataFormatter.booleanFormatter(item.has_build_task) }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.lessons_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Lesson_variants organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>FunctionalRole</th>
                                
                                
                                
                                
                                
                                <th>AdaptationNotes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.lesson_variants_organizations && Array.isArray(organizations.lesson_variants_organizations) &&
                              organizations.lesson_variants_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/lesson_variants/lesson_variants-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="functional_role">
                                        { item.functional_role }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="adaptation_notes">
                                        { item.adaptation_notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.lesson_variants_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Quiz_questions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Prompt</th>
                                
                                
                                
                                <th>QuestionType</th>
                                
                                
                                
                                <th>ChoicesJSON</th>
                                
                                
                                
                                <th>CorrectAnswer</th>
                                
                                
                                
                                <th>Explanation</th>
                                
                                
                                
                                <th>OrderIndex</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.quiz_questions_organizations && Array.isArray(organizations.quiz_questions_organizations) &&
                              organizations.quiz_questions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/quiz_questions/quiz_questions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="prompt">
                                        { item.prompt }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="question_type">
                                        { item.question_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="choices_json">
                                        { item.choices_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="correct_answer">
                                        { item.correct_answer }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="explanation">
                                        { item.explanation }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="order_index">
                                        { item.order_index }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.quiz_questions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Build_tasks organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TaskName</th>
                                
                                
                                
                                
                                
                                <th>SubmissionType</th>
                                
                                
                                
                                <th>ExpectedDeliverable</th>
                                
                                
                                
                                <th>MaxFiles</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.build_tasks_organizations && Array.isArray(organizations.build_tasks_organizations) &&
                              organizations.build_tasks_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/build_tasks/build_tasks-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="submission_type">
                                        { item.submission_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="expected_deliverable">
                                        { item.expected_deliverable }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="max_files">
                                        { item.max_files }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.build_tasks_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Enrollments organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                <th>ProgressPercent</th>
                                
                                
                                
                                <th>CertificationStatus</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.enrollments_organizations && Array.isArray(organizations.enrollments_organizations) &&
                              organizations.enrollments_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/enrollments/enrollments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="progress_percent">
                                        { item.progress_percent }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="certification_status">
                                        { item.certification_status }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.enrollments_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Lesson_progress organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                <th>TimeSpentSeconds</th>
                                
                                
                                
                                <th>LessonProgressPercent</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.lesson_progress_organizations && Array.isArray(organizations.lesson_progress_organizations) &&
                              organizations.lesson_progress_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/lesson_progress/lesson_progress-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="time_spent_seconds">
                                        { item.time_spent_seconds }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lesson_progress_percent">
                                        { item.lesson_progress_percent }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.lesson_progress_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Quiz_attempts organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>ScorePercent</th>
                                
                                
                                
                                <th>CorrectCount</th>
                                
                                
                                
                                <th>QuestionCount</th>
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.quiz_attempts_organizations && Array.isArray(organizations.quiz_attempts_organizations) &&
                              organizations.quiz_attempts_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/quiz_attempts/quiz_attempts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="score_percent">
                                        { item.score_percent }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="correct_count">
                                        { item.correct_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="question_count">
                                        { item.question_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.submitted_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.quiz_attempts_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Task_submissions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SubmissionText</th>
                                
                                
                                
                                
                                
                                <th>SubmissionURL</th>
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                                
                                <th>ReviewedAt</th>
                                
                                
                                
                                
                                
                                <th>AIScore</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.task_submissions_organizations && Array.isArray(organizations.task_submissions_organizations) &&
                              organizations.task_submissions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/task_submissions/task_submissions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submission_text">
                                        { item.submission_text }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="submission_url">
                                        { item.submission_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.submitted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reviewed_at">
                                        { dataFormatter.dateTimeFormatter(item.reviewed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="ai_score">
                                        { item.ai_score }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.task_submissions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Ai_chat_sessions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Mode</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ContextSummary</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>EndedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.ai_chat_sessions_organizations && Array.isArray(organizations.ai_chat_sessions_organizations) &&
                              organizations.ai_chat_sessions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/ai_chat_sessions/ai_chat_sessions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="mode">
                                        { item.mode }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="context_summary">
                                        { item.context_summary }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ended_at">
                                        { dataFormatter.dateTimeFormatter(item.ended_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.ai_chat_sessions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Ai_chat_messages organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Sender</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>AttachmentType</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.ai_chat_messages_organizations && Array.isArray(organizations.ai_chat_messages_organizations) &&
                              organizations.ai_chat_messages_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/ai_chat_messages/ai_chat_messages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="sender">
                                        { item.sender }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="attachment_type">
                                        { item.attachment_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.ai_chat_messages_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Career_coach_reports organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>ResumeText</th>
                                
                                
                                
                                <th>CurrentRole</th>
                                
                                
                                
                                <th>TargetRole</th>
                                
                                
                                
                                <th>ClarifyingQuestions</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>ShareToken</th>
                                
                                
                                
                                <th>GeneratedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.career_coach_reports_organizations && Array.isArray(organizations.career_coach_reports_organizations) &&
                              organizations.career_coach_reports_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/career_coach_reports/career_coach_reports-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resume_text">
                                        { item.resume_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="current_role_text">
                                        { item.current_role_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_role_text">
                                        { item.target_role_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="clarifying_questions">
                                        { item.clarifying_questions }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="share_token">
                                        { item.share_token }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="generated_at">
                                        { dataFormatter.dateTimeFormatter(item.generated_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.career_coach_reports_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Usage_limits organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Feature</th>
                                
                                
                                
                                <th>LimitCount</th>
                                
                                
                                
                                <th>UsedCount</th>
                                
                                
                                
                                <th>WindowStartAt</th>
                                
                                
                                
                                <th>WindowEndAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.usage_limits_organizations && Array.isArray(organizations.usage_limits_organizations) &&
                              organizations.usage_limits_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/usage_limits/usage_limits-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="feature">
                                        { item.feature }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="limit_count">
                                        { item.limit_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="used_count">
                                        { item.used_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="window_start_at">
                                        { dataFormatter.dateTimeFormatter(item.window_start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="window_end_at">
                                        { dataFormatter.dateTimeFormatter(item.window_end_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.usage_limits_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Pricing_plans organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>PlanName</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>PriceAmount</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>BillingInterval</th>
                                
                                
                                
                                <th>StripePriceRef</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.pricing_plans_organizations && Array.isArray(organizations.pricing_plans_organizations) &&
                              organizations.pricing_plans_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/pricing_plans/pricing_plans-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price_amount">
                                        { item.price_amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="billing_interval">
                                        { item.billing_interval }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stripe_price_ref">
                                        { item.stripe_price_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.pricing_plans_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Subscriptions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>StripeCustomerRef</th>
                                
                                
                                
                                <th>StripeSubscriptionRef</th>
                                
                                
                                
                                <th>CurrentPeriodStartAt</th>
                                
                                
                                
                                <th>CurrentPeriodEndAt</th>
                                
                                
                                
                                <th>CanceledAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.subscriptions_organizations && Array.isArray(organizations.subscriptions_organizations) &&
                              organizations.subscriptions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/subscriptions/subscriptions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stripe_customer_ref">
                                        { item.stripe_customer_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stripe_subscription_ref">
                                        { item.stripe_subscription_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="current_period_start_at">
                                        { dataFormatter.dateTimeFormatter(item.current_period_start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="current_period_end_at">
                                        { dataFormatter.dateTimeFormatter(item.current_period_end_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="canceled_at">
                                        { dataFormatter.dateTimeFormatter(item.canceled_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.subscriptions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Payments organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Amount</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>StripePaymentIntentRef</th>
                                
                                
                                
                                <th>ReceiptURL</th>
                                
                                
                                
                                <th>PaidAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.payments_organizations && Array.isArray(organizations.payments_organizations) &&
                              organizations.payments_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/payments/payments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="amount">
                                        { item.amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stripe_payment_intent_ref">
                                        { item.stripe_payment_intent_ref }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="receipt_url">
                                        { item.receipt_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="paid_at">
                                        { dataFormatter.dateTimeFormatter(item.paid_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.payments_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Cohorts organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CohortName</th>
                                
                                
                                
                                <th>StartsAt</th>
                                
                                
                                
                                <th>EndsAt</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>MaxLearners</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.cohorts_organizations && Array.isArray(organizations.cohorts_organizations) &&
                              organizations.cohorts_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/cohorts/cohorts-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="starts_at">
                                        { dataFormatter.dateTimeFormatter(item.starts_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ends_at">
                                        { dataFormatter.dateTimeFormatter(item.ends_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="max_learners">
                                        { item.max_learners }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.cohorts_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Organization_memberships Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>MemberRole</th>
                                
                                
                                
                                <th>JoinedAt</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.organization_memberships_organization && Array.isArray(organizations.organization_memberships_organization) &&
                              organizations.organization_memberships_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/organization_memberships/organization_memberships-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="member_role">
                                        { item.member_role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="joined_at">
                                        { dataFormatter.dateTimeFormatter(item.joined_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.organization_memberships_organization?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Talent_inquiries Organization</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>Subject</th>
                                
                                
                                
                                <th>Message</th>
                                
                                
                                
                                <th>ContactEmail</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.talent_inquiries_organization && Array.isArray(organizations.talent_inquiries_organization) &&
                              organizations.talent_inquiries_organization.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/talent_inquiries/talent_inquiries-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="subject">
                                        { item.subject }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="message">
                                        { item.message }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="contact_email">
                                        { item.contact_email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.talent_inquiries_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;