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/conferences/conferencesSlice'
import {saveFile} from "../../helpers/fileSaver";
import dataFormatter from '../../helpers/dataFormatter';
import ImageField from "../../components/ImageField";
import LayoutAuthenticated from "../../layouts/Authenticated";
import {getPageTitle} from "../../config";
import SectionTitleLineWithButton from "../../components/SectionTitleLineWithButton";
import SectionMain from "../../components/SectionMain";
import CardBox from "../../components/CardBox";
import BaseButton from "../../components/BaseButton";
import BaseDivider from "../../components/BaseDivider";
import {mdiChartTimelineVariant} from "@mdi/js";
import {SwitchField} from "../../components/SwitchField";
import FormField from "../../components/FormField";

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


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

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

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


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

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Room</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{conferences?.room?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ConferenceKey</p>
                    <p>{conferences?.conference_key}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ConferenceType</p>
                    <p>{conferences?.conference_type ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ConferenceStatus</p>
                    <p>{conferences?.conference_status ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ScheduledStartAt'>
                    {conferences.scheduled_start_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={conferences.scheduled_start_at ?
                        new Date(
                          dayjs(conferences.scheduled_start_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ScheduledStartAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ScheduledEndAt'>
                    {conferences.scheduled_end_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={conferences.scheduled_end_at ?
                        new Date(
                          dayjs(conferences.scheduled_end_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ScheduledEndAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ActualStartAt'>
                    {conferences.actual_start_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={conferences.actual_start_at ?
                        new Date(
                          dayjs(conferences.actual_start_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ActualStartAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ActualEndAt'>
                    {conferences.actual_end_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={conferences.actual_end_at ?
                        new Date(
                          dayjs(conferences.actual_end_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ActualEndAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

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

              

              

              

              
              

              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>ParticipantLimit</p>
                  <p>{conferences?.participant_limit || 'No data'}</p>
                </div>
              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>RegionPreference</p>
                    <p>{conferences?.region_preference ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

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

              

              

              
              

                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Participants Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>DisplayName</th>
                                
                                
                                
                                <th>ParticipantRole</th>
                                
                                
                                
                                <th>JoinStatus</th>
                                
                                
                                
                                <th>JoinedAt</th>
                                
                                
                                
                                <th>LeftAt</th>
                                
                                
                                
                                <th>IsMuted</th>
                                
                                
                                
                                <th>IsVideoEnabled</th>
                                
                                
                                
                                <th>IsScreenSharing</th>
                                
                                
                                
                                <th>NetworkScore</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.participants_conference && Array.isArray(conferences.participants_conference) &&
                              conferences.participants_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/participants/participants-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="display_name">
                                        { item.display_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="participant_role">
                                        { item.participant_role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="join_status">
                                        { item.join_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="joined_at">
                                        { dataFormatter.dateTimeFormatter(item.joined_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="left_at">
                                        { dataFormatter.dateTimeFormatter(item.left_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_muted">
                                        { dataFormatter.booleanFormatter(item.is_muted) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_video_enabled">
                                        { dataFormatter.booleanFormatter(item.is_video_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_screen_sharing">
                                        { dataFormatter.booleanFormatter(item.is_screen_sharing) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="network_score">
                                        { item.network_score }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.participants_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Sfu_allocations Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>AllocationRole</th>
                                
                                
                                
                                <th>AllocatedAt</th>
                                
                                
                                
                                <th>ReleasedAt</th>
                                
                                
                                
                                <th>AllocationStatus</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.sfu_allocations_conference && Array.isArray(conferences.sfu_allocations_conference) &&
                              conferences.sfu_allocations_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/sfu_allocations/sfu_allocations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="allocation_role">
                                        { item.allocation_role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="allocated_at">
                                        { dataFormatter.dateTimeFormatter(item.allocated_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="released_at">
                                        { dataFormatter.dateTimeFormatter(item.released_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="allocation_status">
                                        { item.allocation_status }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.sfu_allocations_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Breakout_rooms Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>BreakoutRoomName</th>
                                
                                
                                
                                <th>BreakoutKey</th>
                                
                                
                                
                                <th>BreakoutStatus</th>
                                
                                
                                
                                <th>TargetParticipants</th>
                                
                                
                                
                                <th>OpenedAt</th>
                                
                                
                                
                                <th>ClosedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.breakout_rooms_conference && Array.isArray(conferences.breakout_rooms_conference) &&
                              conferences.breakout_rooms_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/breakout_rooms/breakout_rooms-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="breakout_key">
                                        { item.breakout_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="breakout_status">
                                        { item.breakout_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_participants">
                                        { item.target_participants }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="opened_at">
                                        { dataFormatter.dateTimeFormatter(item.opened_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="closed_at">
                                        { dataFormatter.dateTimeFormatter(item.closed_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.breakout_rooms_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Chat_channels Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ChannelName</th>
                                
                                
                                
                                <th>ChannelType</th>
                                
                                
                                
                                <th>IsModerated</th>
                                
                                
                                
                                <th>LastMessageAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.chat_channels_conference && Array.isArray(conferences.chat_channels_conference) &&
                              conferences.chat_channels_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/chat_channels/chat_channels-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="channel_type">
                                        { item.channel_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_moderated">
                                        { dataFormatter.booleanFormatter(item.is_moderated) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="last_message_at">
                                        { dataFormatter.dateTimeFormatter(item.last_message_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.chat_channels_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Recordings Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>RecordingStatus</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>EndedAt</th>
                                
                                
                                
                                <th>Duration(Minutes)</th>
                                
                                
                                
                                <th>StorageURI</th>
                                
                                
                                
                                
                                
                                <th>FailureReason</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.recordings_conference && Array.isArray(conferences.recordings_conference) &&
                              conferences.recordings_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/recordings/recordings-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="recording_status">
                                        { item.recording_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ended_at">
                                        { dataFormatter.dateTimeFormatter(item.ended_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="duration_minutes">
                                        { item.duration_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="storage_uri">
                                        { item.storage_uri }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="failure_reason">
                                        { item.failure_reason }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.recordings_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Transcripts Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TranscriptStatus</th>
                                
                                
                                
                                <th>LanguageCode</th>
                                
                                
                                
                                <th>Content</th>
                                
                                
                                
                                <th>GeneratedAt</th>
                                
                                
                                
                                <th>OptIn</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.transcripts_conference && Array.isArray(conferences.transcripts_conference) &&
                              conferences.transcripts_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/transcripts/transcripts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="transcript_status">
                                        { item.transcript_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="language_code">
                                        { item.language_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="content">
                                        { item.content }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="generated_at">
                                        { dataFormatter.dateTimeFormatter(item.generated_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="opt_in">
                                        { dataFormatter.booleanFormatter(item.opt_in) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.transcripts_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Ai_companion_sessions Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>CompanionStatus</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>EndedAt</th>
                                
                                
                                
                                <th>AutoActionsEnabled</th>
                                
                                
                                
                                <th>SystemPromptVersion</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.ai_companion_sessions_conference && Array.isArray(conferences.ai_companion_sessions_conference) &&
                              conferences.ai_companion_sessions_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/ai_companion_sessions/ai_companion_sessions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="companion_status">
                                        { item.companion_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ended_at">
                                        { dataFormatter.dateTimeFormatter(item.ended_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="auto_actions_enabled">
                                        { dataFormatter.booleanFormatter(item.auto_actions_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="system_prompt_version">
                                        { item.system_prompt_version }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.ai_companion_sessions_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Quality_reports Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>ReportedAt</th>
                                
                                
                                
                                <th>PacketLossPercent</th>
                                
                                
                                
                                <th>RTT(ms)</th>
                                
                                
                                
                                <th>Jitter(ms)</th>
                                
                                
                                
                                <th>SendBitrate(kbps)</th>
                                
                                
                                
                                <th>ReceiveBitrate(kbps)</th>
                                
                                
                                
                                <th>MediaQuality</th>
                                
                                
                                
                                <th>RawStats</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.quality_reports_conference && Array.isArray(conferences.quality_reports_conference) &&
                              conferences.quality_reports_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/quality_reports/quality_reports-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reported_at">
                                        { dataFormatter.dateTimeFormatter(item.reported_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="packet_loss_percent">
                                        { item.packet_loss_percent }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rtt_ms">
                                        { item.rtt_ms }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="jitter_ms">
                                        { item.jitter_ms }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="send_bitrate_kbps">
                                        { item.send_bitrate_kbps }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="recv_bitrate_kbps">
                                        { item.recv_bitrate_kbps }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="media_quality">
                                        { item.media_quality }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="raw_stats">
                                        { item.raw_stats }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.quality_reports_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Conference_events Conference</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>EventKind</th>
                                
                                
                                
                                <th>EventKey</th>
                                
                                
                                
                                <th>EventAt</th>
                                
                                
                                
                                <th>Payload</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {conferences.conference_events_conference && Array.isArray(conferences.conference_events_conference) &&
                              conferences.conference_events_conference.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/conference_events/conference_events-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="event_kind">
                                        { item.event_kind }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="event_key">
                                        { item.event_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="event_at">
                                        { dataFormatter.dateTimeFormatter(item.event_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="payload">
                                        { item.payload }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!conferences?.conference_events_conference?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

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

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

export default ConferencesView;