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/users/usersSlice'
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";


const UsersView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { users } = useAppSelector((state) => state.users)
    

    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 users')}</title>
          </Head>
          <SectionMain>
            <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title={removeLastCharacter('View users')} main>
                <BaseButton
                  color='info'
                  label='Edit'
                  href={`/users/users-edit/?id=${id}`}
                />
            </SectionTitleLineWithButton>
            <CardBox>
            

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

              

              

              

              

              

              

              

              

              

              

              

              
              

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

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Phone Number</p>
                    <p>{users?.phoneNumber}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>E-Mail</p>
                    <p>{users?.email}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              
                <FormField label='Disabled'>
                    <SwitchField
                      field={{name: 'disabled', value: users?.disabled}}
                      form={{setFieldValue: () => null}}
                      disabled
                    />
                </FormField>
              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Avatar</p>
                    {users?.avatar?.length
                      ? (
                        <ImageField
                          name={'avatar'}
                          image={users?.avatar}
                          className='w-20 h-20'
                        />
                      ) : <p>No Avatar</p>
                    }
                </div>
              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>App Role</p>
                    
                    
                    
                    
                        <p>{users?.app_role?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              

              
                <>
                    <p className={'block font-bold mb-2'}>Custom Permissions</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                    <th>Name</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.custom_permissions && Array.isArray(users.custom_permissions) &&
                              users.custom_permissions.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/permissions/permissions-view/?id=${item.id}`)}>
                                  
                                    
                                    
                                  
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.custom_permissions?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
              

              

              
              

                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Tutor_profiles User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Headline</th>
                                
                                
                                
                                <th>TeachingType</th>
                                
                                
                                
                                <th>InstitutionName</th>
                                
                                
                                
                                <th>DegreeOrQualification</th>
                                
                                
                                
                                <th>GraduationYear</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>SessionLanguage</th>
                                
                                
                                
                                <th>TeachingFormat</th>
                                
                                
                                
                                <th>VerificationStatus</th>
                                
                                
                                
                                
                                
                                <th>VerificationNote</th>
                                
                                
                                
                                <th>Rating</th>
                                
                                
                                
                                <th>TotalSessions</th>
                                
                                
                                
                                <th>TotalReviews</th>
                                
                                
                                
                                <th>ResponseRatePercent</th>
                                
                                
                                
                                <th>ResponseTimeHours</th>
                                
                                
                                
                                <th>BadgeLevel</th>
                                
                                
                                
                                <th>VacationMode</th>
                                
                                
                                
                                <th>MaxConcurrentBookings</th>
                                
                                
                                
                                <th>JitsiMeetingID</th>
                                
                                
                                
                                <th>JitsiMeetingPassword</th>
                                
                                
                                
                                <th>AvailabilityScheduleJSON</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.tutor_profiles_user && Array.isArray(users.tutor_profiles_user) &&
                              users.tutor_profiles_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/tutor_profiles/tutor_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="headline">
                                        { item.headline }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="teaching_type">
                                        { item.teaching_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="institution_name">
                                        { item.institution_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="degree_qualification">
                                        { item.degree_qualification }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="graduation_year">
                                        { item.graduation_year }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="session_language">
                                        { item.session_language }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="teaching_format">
                                        { item.teaching_format }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="verification_status">
                                        { item.verification_status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="verification_note">
                                        { item.verification_note }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rating">
                                        { item.rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="total_sessions">
                                        { item.total_sessions }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="total_reviews">
                                        { item.total_reviews }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="response_rate">
                                        { item.response_rate }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="response_time_hours">
                                        { item.response_time_hours }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="badge_level">
                                        { item.badge_level }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="vacation_mode">
                                        { dataFormatter.booleanFormatter(item.vacation_mode) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="max_concurrent_bookings">
                                        { item.max_concurrent_bookings }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_meeting_id">
                                        { item.jitsi_meet_meeting_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_password">
                                        { item.jitsi_meet_password }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="availability_json">
                                        { item.availability_json }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.tutor_profiles_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Learner_profiles User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>MainGoal</th>
                                
                                
                                
                                <th>PreferredSessionFormat</th>
                                
                                
                                
                                <th>SessionLanguagePreference</th>
                                
                                
                                
                                <th>BudgetRangePerSession</th>
                                
                                
                                
                                <th>AvailabilityPreferencesJSON</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.learner_profiles_user && Array.isArray(users.learner_profiles_user) &&
                              users.learner_profiles_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/learner_profiles/learner_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="main_goal">
                                        { item.main_goal }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="preferred_session_format">
                                        { item.preferred_session_format }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="session_language_preference">
                                        { item.session_language_preference }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="budget_range">
                                        { item.budget_range }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="availability_json">
                                        { item.availability_json }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.learner_profiles_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Bookings Learner</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>LevelNumberSnapshot</th>
                                
                                
                                
                                <th>LevelNameSnapshot</th>
                                
                                
                                
                                <th>Price</th>
                                
                                
                                
                                <th>PlatformFee</th>
                                
                                
                                
                                <th>TutorPayout</th>
                                
                                
                                
                                <th>BookingStatus</th>
                                
                                
                                
                                <th>EscrowStatus</th>
                                
                                
                                
                                <th>ScheduledAt</th>
                                
                                
                                
                                <th>AcceptedAt</th>
                                
                                
                                
                                <th>MilestoneSubmittedAt</th>
                                
                                
                                
                                <th>AutoReleaseAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                <th>DeliverableNotes</th>
                                
                                
                                
                                
                                
                                <th>RevisionCount</th>
                                
                                
                                
                                <th>RevisionReason</th>
                                
                                
                                
                                <th>JitsiMeetingID</th>
                                
                                
                                
                                <th>JitsiMeetingPassword</th>
                                
                                
                                
                                <th>AdminNote</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.bookings_learner && Array.isArray(users.bookings_learner) &&
                              users.bookings_learner.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bookings/bookings-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="level_number">
                                        { item.level_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="level_name">
                                        { item.level_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price">
                                        { item.price }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="platform_fee">
                                        { item.platform_fee }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_payout">
                                        { item.tutor_payout }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="escrow_status">
                                        { item.escrow_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="accepted_at">
                                        { dataFormatter.dateTimeFormatter(item.accepted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="milestone_submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.milestone_submitted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="auto_release_at">
                                        { dataFormatter.dateTimeFormatter(item.auto_release_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="deliverable_notes">
                                        { item.deliverable_notes }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="revision_count">
                                        { item.revision_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="revision_reason">
                                        { item.revision_reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_meeting_id">
                                        { item.jitsi_meet_meeting_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_password">
                                        { item.jitsi_meet_password }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="admin_note">
                                        { item.admin_note }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.bookings_learner?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Bookings Tutor</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>LevelNumberSnapshot</th>
                                
                                
                                
                                <th>LevelNameSnapshot</th>
                                
                                
                                
                                <th>Price</th>
                                
                                
                                
                                <th>PlatformFee</th>
                                
                                
                                
                                <th>TutorPayout</th>
                                
                                
                                
                                <th>BookingStatus</th>
                                
                                
                                
                                <th>EscrowStatus</th>
                                
                                
                                
                                <th>ScheduledAt</th>
                                
                                
                                
                                <th>AcceptedAt</th>
                                
                                
                                
                                <th>MilestoneSubmittedAt</th>
                                
                                
                                
                                <th>AutoReleaseAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                <th>DeliverableNotes</th>
                                
                                
                                
                                
                                
                                <th>RevisionCount</th>
                                
                                
                                
                                <th>RevisionReason</th>
                                
                                
                                
                                <th>JitsiMeetingID</th>
                                
                                
                                
                                <th>JitsiMeetingPassword</th>
                                
                                
                                
                                <th>AdminNote</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.bookings_tutor && Array.isArray(users.bookings_tutor) &&
                              users.bookings_tutor.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bookings/bookings-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="level_number">
                                        { item.level_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="level_name">
                                        { item.level_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price">
                                        { item.price }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="platform_fee">
                                        { item.platform_fee }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_payout">
                                        { item.tutor_payout }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="escrow_status">
                                        { item.escrow_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="accepted_at">
                                        { dataFormatter.dateTimeFormatter(item.accepted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="milestone_submitted_at">
                                        { dataFormatter.dateTimeFormatter(item.milestone_submitted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="auto_release_at">
                                        { dataFormatter.dateTimeFormatter(item.auto_release_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="deliverable_notes">
                                        { item.deliverable_notes }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="revision_count">
                                        { item.revision_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="revision_reason">
                                        { item.revision_reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_meeting_id">
                                        { item.jitsi_meet_meeting_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitsi_meet_password">
                                        { item.jitsi_meet_password }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="admin_note">
                                        { item.admin_note }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.bookings_tutor?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Conversations Tutor</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>LastMessage</th>
                                
                                
                                
                                <th>LastMessageAt</th>
                                
                                
                                
                                <th>TutorUnreadCount</th>
                                
                                
                                
                                <th>LearnerUnreadCount</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.conversations_tutor && Array.isArray(users.conversations_tutor) &&
                              users.conversations_tutor.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/conversations/conversations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="last_message">
                                        { item.last_message }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_message_at">
                                        { dataFormatter.dateTimeFormatter(item.last_message_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_unread_count">
                                        { item.tutor_unread_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="learner_unread_count">
                                        { item.learner_unread_count }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.conversations_tutor?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Conversations Learner</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>LastMessage</th>
                                
                                
                                
                                <th>LastMessageAt</th>
                                
                                
                                
                                <th>TutorUnreadCount</th>
                                
                                
                                
                                <th>LearnerUnreadCount</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.conversations_learner && Array.isArray(users.conversations_learner) &&
                              users.conversations_learner.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/conversations/conversations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="last_message">
                                        { item.last_message }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_message_at">
                                        { dataFormatter.dateTimeFormatter(item.last_message_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_unread_count">
                                        { item.tutor_unread_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="learner_unread_count">
                                        { item.learner_unread_count }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.conversations_learner?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Messages Sender</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>MessageType</th>
                                
                                
                                
                                <th>Content</th>
                                
                                
                                
                                <th>FileURL</th>
                                
                                
                                
                                <th>FileName</th>
                                
                                
                                
                                <th>PIIMasked</th>
                                
                                
                                
                                <th>Read</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.messages_sender && Array.isArray(users.messages_sender) &&
                              users.messages_sender.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/messages/messages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content">
                                        { item.content }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_url">
                                        { item.file_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_name">
                                        { item.file_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_pii_masked">
                                        { dataFormatter.booleanFormatter(item.is_pii_masked) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_read">
                                        { dataFormatter.booleanFormatter(item.is_read) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.messages_sender?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Messages Receiver</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>MessageType</th>
                                
                                
                                
                                <th>Content</th>
                                
                                
                                
                                <th>FileURL</th>
                                
                                
                                
                                <th>FileName</th>
                                
                                
                                
                                <th>PIIMasked</th>
                                
                                
                                
                                <th>Read</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.messages_receiver && Array.isArray(users.messages_receiver) &&
                              users.messages_receiver.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/messages/messages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content">
                                        { item.content }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_url">
                                        { item.file_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_name">
                                        { item.file_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_pii_masked">
                                        { dataFormatter.booleanFormatter(item.is_pii_masked) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_read">
                                        { dataFormatter.booleanFormatter(item.is_read) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.messages_receiver?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Reviews Tutor</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>OverallRating</th>
                                
                                
                                
                                <th>CommunicationRating</th>
                                
                                
                                
                                <th>KnowledgeRating</th>
                                
                                
                                
                                <th>PunctualityRating</th>
                                
                                
                                
                                <th>ValueRating</th>
                                
                                
                                
                                <th>ReviewText</th>
                                
                                
                                
                                <th>WouldRecommend</th>
                                
                                
                                
                                <th>TutorResponse</th>
                                
                                
                                
                                <th>TutorResponseAt</th>
                                
                                
                                
                                <th>ModerationStatus</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.reviews_tutor && Array.isArray(users.reviews_tutor) &&
                              users.reviews_tutor.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/reviews/reviews-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="rating">
                                        { item.rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="communication_rating">
                                        { item.communication_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="knowledge_rating">
                                        { item.knowledge_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="punctuality_rating">
                                        { item.punctuality_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="value_rating">
                                        { item.value_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="review_text">
                                        { item.review_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="would_recommend">
                                        { dataFormatter.booleanFormatter(item.would_recommend) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_response">
                                        { item.tutor_response }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_response_at">
                                        { dataFormatter.dateTimeFormatter(item.tutor_response_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.reviews_tutor?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Reviews Learner</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>OverallRating</th>
                                
                                
                                
                                <th>CommunicationRating</th>
                                
                                
                                
                                <th>KnowledgeRating</th>
                                
                                
                                
                                <th>PunctualityRating</th>
                                
                                
                                
                                <th>ValueRating</th>
                                
                                
                                
                                <th>ReviewText</th>
                                
                                
                                
                                <th>WouldRecommend</th>
                                
                                
                                
                                <th>TutorResponse</th>
                                
                                
                                
                                <th>TutorResponseAt</th>
                                
                                
                                
                                <th>ModerationStatus</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.reviews_learner && Array.isArray(users.reviews_learner) &&
                              users.reviews_learner.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/reviews/reviews-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="rating">
                                        { item.rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="communication_rating">
                                        { item.communication_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="knowledge_rating">
                                        { item.knowledge_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="punctuality_rating">
                                        { item.punctuality_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="value_rating">
                                        { item.value_rating }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="review_text">
                                        { item.review_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="would_recommend">
                                        { dataFormatter.booleanFormatter(item.would_recommend) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_response">
                                        { item.tutor_response }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tutor_response_at">
                                        { dataFormatter.dateTimeFormatter(item.tutor_response_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.reviews_learner?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Disputes OpenedBy</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Resolution</th>
                                
                                
                                
                                <th>AdminNotes</th>
                                
                                
                                
                                
                                
                                <th>ResolvedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.disputes_opened_by && Array.isArray(users.disputes_opened_by) &&
                              users.disputes_opened_by.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/disputes/disputes-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolution">
                                        { item.resolution }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="admin_notes">
                                        { item.admin_notes }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolved_at">
                                        { dataFormatter.dateTimeFormatter(item.resolved_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.disputes_opened_by?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Disputes ResolvedBy</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Resolution</th>
                                
                                
                                
                                <th>AdminNotes</th>
                                
                                
                                
                                
                                
                                <th>ResolvedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.disputes_resolved_by && Array.isArray(users.disputes_resolved_by) &&
                              users.disputes_resolved_by.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/disputes/disputes-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolution">
                                        { item.resolution }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="admin_notes">
                                        { item.admin_notes }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolved_at">
                                        { dataFormatter.dateTimeFormatter(item.resolved_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.disputes_resolved_by?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Notifications User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Type</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Body</th>
                                
                                
                                
                                <th>Link</th>
                                
                                
                                
                                <th>Read</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.notifications_user && Array.isArray(users.notifications_user) &&
                              users.notifications_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/notifications/notifications-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="body">
                                        { item.body }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="link">
                                        { item.link }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_read">
                                        { dataFormatter.booleanFormatter(item.is_read) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.notifications_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Admin_audit_logs AdminUser</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Action</th>
                                
                                
                                
                                <th>TargetEntity</th>
                                
                                
                                
                                <th>TargetID</th>
                                
                                
                                
                                <th>Details</th>
                                
                                
                                
                                <th>OccurredAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.admin_audit_logs_admin_user && Array.isArray(users.admin_audit_logs_admin_user) &&
                              users.admin_audit_logs_admin_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/admin_audit_logs/admin_audit_logs-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="action">
                                        { item.action }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_entity">
                                        { item.target_entity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_id">
                                        { item.target_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="details">
                                        { item.details }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="occurred_at">
                                        { dataFormatter.dateTimeFormatter(item.occurred_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.admin_audit_logs_admin_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>User_login_history User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>DeviceLabel</th>
                                
                                
                                
                                <th>IPAddress</th>
                                
                                
                                
                                <th>Event</th>
                                
                                
                                
                                <th>OccurredAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.user_login_history_user && Array.isArray(users.user_login_history_user) &&
                              users.user_login_history_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_login_history/user_login_history-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="device_label">
                                        { item.device_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ip_address">
                                        { item.ip_address }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="event">
                                        { item.event }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="occurred_at">
                                        { dataFormatter.dateTimeFormatter(item.occurred_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.user_login_history_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Invites Sender</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Message</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                                
                                <th>RespondedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.invites_sender && Array.isArray(users.invites_sender) &&
                              users.invites_sender.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/invites/invites-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="message">
                                        { item.message }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="responded_at">
                                        { dataFormatter.dateTimeFormatter(item.responded_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.invites_sender?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Invites Receiver</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Message</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                                
                                <th>RespondedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.invites_receiver && Array.isArray(users.invites_receiver) &&
                              users.invites_receiver.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/invites/invites-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="message">
                                        { item.message }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="responded_at">
                                        { dataFormatter.dateTimeFormatter(item.responded_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.invites_receiver?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Space_memberships User</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>MembershipStatus</th>
                                
                                
                                
                                <th>JoinedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.space_memberships_user && Array.isArray(users.space_memberships_user) &&
                              users.space_memberships_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/space_memberships/space_memberships-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="role">
                                        { item.role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="joined_at">
                                        { dataFormatter.dateTimeFormatter(item.joined_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.space_memberships_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Community_posts Author</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>PostType</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Body</th>
                                
                                
                                
                                <th>ImageURL</th>
                                
                                
                                
                                <th>ResourceURL</th>
                                
                                
                                
                                <th>PollOptionsJSON</th>
                                
                                
                                
                                <th>Pinned</th>
                                
                                
                                
                                <th>PostVisibility</th>
                                
                                
                                
                                <th>LikeCount</th>
                                
                                
                                
                                <th>LoveCount</th>
                                
                                
                                
                                <th>InsightfulCount</th>
                                
                                
                                
                                <th>CommentCount</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.community_posts_author && Array.isArray(users.community_posts_author) &&
                              users.community_posts_author.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/community_posts/community_posts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="post_type">
                                        { item.post_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="body">
                                        { item.body }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="image_url">
                                        { item.image_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="resource_url">
                                        { item.resource_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="poll_options_json">
                                        { item.poll_options_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_pinned">
                                        { dataFormatter.booleanFormatter(item.is_pinned) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="like_count">
                                        { item.like_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="love_count">
                                        { item.love_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="insightful_count">
                                        { item.insightful_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="comment_count">
                                        { item.comment_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.community_posts_author?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Community_comments Author</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Comment</th>
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>LikeCount</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.community_comments_author && Array.isArray(users.community_comments_author) &&
                              users.community_comments_author.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/community_comments/community_comments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="body">
                                        { item.body }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="like_count">
                                        { item.like_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.community_comments_author?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Community_reactions User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>ReactionType</th>
                                
                                
                                
                                <th>ReactedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.community_reactions_user && Array.isArray(users.community_reactions_user) &&
                              users.community_reactions_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/community_reactions/community_reactions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reaction_type">
                                        { item.reaction_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reacted_at">
                                        { dataFormatter.dateTimeFormatter(item.reacted_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.community_reactions_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Community_reports Reporter</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ContentType</th>
                                
                                
                                
                                <th>ContentID</th>
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                <th>Details</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                <th>ResolvedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.community_reports_reporter && Array.isArray(users.community_reports_reporter) &&
                              users.community_reports_reporter.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/community_reports/community_reports-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="content_type">
                                        { item.content_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content_id">
                                        { item.content_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="details">
                                        { item.details }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolved_at">
                                        { dataFormatter.dateTimeFormatter(item.resolved_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.community_reports_reporter?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Community_reports ResolvedBy</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ContentType</th>
                                
                                
                                
                                <th>ContentID</th>
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                <th>Details</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                <th>ResolvedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.community_reports_resolved_by && Array.isArray(users.community_reports_resolved_by) &&
                              users.community_reports_resolved_by.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/community_reports/community_reports-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="content_type">
                                        { item.content_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content_id">
                                        { item.content_id }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="details">
                                        { item.details }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="resolved_at">
                                        { dataFormatter.dateTimeFormatter(item.resolved_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.community_reports_resolved_by?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Challenge_participations User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>ProgressValue</th>
                                
                                
                                
                                <th>TargetValue</th>
                                
                                
                                
                                <th>Completed</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.challenge_participations_user && Array.isArray(users.challenge_participations_user) &&
                              users.challenge_participations_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/challenge_participations/challenge_participations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="progress_value">
                                        { item.progress_value }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_value">
                                        { item.target_value }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_completed">
                                        { dataFormatter.booleanFormatter(item.is_completed) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.challenge_participations_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>User_gamification User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TotalPoints</th>
                                
                                
                                
                                <th>StreakDays</th>
                                
                                
                                
                                <th>LastActivityAt</th>
                                
                                
                                
                                <th>DailyActivityLogJSON</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.user_gamification_user && Array.isArray(users.user_gamification_user) &&
                              users.user_gamification_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_gamification/user_gamification-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="points_total">
                                        { item.points_total }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="streak_days">
                                        { item.streak_days }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_activity_at">
                                        { dataFormatter.dateTimeFormatter(item.last_activity_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="daily_activity_json">
                                        { item.daily_activity_json }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.user_gamification_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>User_badges User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>EarnedAt</th>
                                
                                
                                
                                <th>Context</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.user_badges_user && Array.isArray(users.user_badges_user) &&
                              users.user_badges_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_badges/user_badges-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="earned_at">
                                        { dataFormatter.dateTimeFormatter(item.earned_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="context">
                                        { item.context }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.user_badges_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Study_groups Owner</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>GroupName</th>
                                
                                
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>MemberLimit</th>
                                
                                
                                
                                
                                
                                <th>Description</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.study_groups_owner && Array.isArray(users.study_groups_owner) &&
                              users.study_groups_owner.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/study_groups/study_groups-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="member_limit">
                                        { item.member_limit }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.study_groups_owner?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Study_group_memberships User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Role</th>
                                
                                
                                
                                <th>JoinedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.study_group_memberships_user && Array.isArray(users.study_group_memberships_user) &&
                              users.study_group_memberships_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/study_group_memberships/study_group_memberships-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="role">
                                        { item.role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="joined_at">
                                        { dataFormatter.dateTimeFormatter(item.joined_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.study_group_memberships_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Study_group_posts Author</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Body</th>
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.study_group_posts_author && Array.isArray(users.study_group_posts_author) &&
                              users.study_group_posts_author.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/study_group_posts/study_group_posts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="body">
                                        { item.body }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.study_group_posts_author?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Study_group_messages Sender</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>MessageType</th>
                                
                                
                                
                                <th>Content</th>
                                
                                
                                
                                <th>FileName</th>
                                
                                
                                
                                <th>FileURL</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.study_group_messages_sender && Array.isArray(users.study_group_messages_sender) &&
                              users.study_group_messages_sender.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/study_group_messages/study_group_messages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content">
                                        { item.content }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_name">
                                        { item.file_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="file_url">
                                        { item.file_url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.study_group_messages_sender?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Study_group_resources AddedBy</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>URL</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.study_group_resources_added_by && Array.isArray(users.study_group_resources_added_by) &&
                              users.study_group_resources_added_by.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/study_group_resources/study_group_resources-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="url">
                                        { item.url }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.study_group_resources_added_by?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Live_events Host</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>EventTitle</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>EventType</th>
                                
                                
                                
                                <th>MeetingProvider</th>
                                
                                
                                
                                <th>MeetingLink</th>
                                
                                
                                
                                <th>RecordingLink</th>
                                
                                
                                
                                <th>StartAt</th>
                                
                                
                                
                                <th>EndAt</th>
                                
                                
                                
                                <th>Capacity</th>
                                
                                
                                
                                <th>PriceAmount</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.live_events_host && Array.isArray(users.live_events_host) &&
                              users.live_events_host.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/live_events/live_events-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="event_type">
                                        { item.event_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="meeting_provider">
                                        { item.meeting_provider }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="meeting_link">
                                        { item.meeting_link }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="recording_link">
                                        { item.recording_link }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="start_at">
                                        { dataFormatter.dateTimeFormatter(item.start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="end_at">
                                        { dataFormatter.dateTimeFormatter(item.end_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price_amount">
                                        { item.price_amount }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.live_events_host?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Event_rsvps User</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>RSVPStatus</th>
                                
                                
                                
                                <th>RSVPedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.event_rsvps_user && Array.isArray(users.event_rsvps_user) &&
                              users.event_rsvps_user.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/event_rsvps/event_rsvps-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rsvped_at">
                                        { dataFormatter.dateTimeFormatter(item.rsvped_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.event_rsvps_user?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Certificates Learner</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>SubjectLabel</th>
                                
                                
                                
                                <th>LevelLabel</th>
                                
                                
                                
                                <th>IssuedAt</th>
                                
                                
                                
                                <th>CertificateHTML</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.certificates_learner && Array.isArray(users.certificates_learner) &&
                              users.certificates_learner.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/certificates/certificates-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="subject_label">
                                        { item.subject_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="level_label">
                                        { item.level_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="issued_at">
                                        { dataFormatter.dateTimeFormatter(item.issued_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="certificate_html">
                                        { item.certificate_html }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.certificates_learner?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                <>
                    <p className={'block font-bold mb-2'}>Certificates Tutor</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>SubjectLabel</th>
                                
                                
                                
                                <th>LevelLabel</th>
                                
                                
                                
                                <th>IssuedAt</th>
                                
                                
                                
                                <th>CertificateHTML</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {users.certificates_tutor && Array.isArray(users.certificates_tutor) &&
                              users.certificates_tutor.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/certificates/certificates-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="subject_label">
                                        { item.subject_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="level_label">
                                        { item.level_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="issued_at">
                                        { dataFormatter.dateTimeFormatter(item.issued_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="certificate_html">
                                        { item.certificate_html }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!users?.certificates_tutor?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

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

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

export default UsersView;