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/camp_sessions/camp_sessionsSlice'
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 Camp_sessionsView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { camp_sessions } = useAppSelector((state) => state.camp_sessions)
    

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

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

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ThemeTitle</p>
                    <p>{camp_sessions?.theme_title}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>ThemeSummary</p>
                  {camp_sessions.theme_summary
                    ? <p dangerouslySetInnerHTML={{__html: camp_sessions.theme_summary}}/>
                    : <p>No data</p>
                  }
                </div>
              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ThemeScriptureReference</p>
                    <p>{camp_sessions?.theme_scripture_reference}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>ThemeScriptureText</p>
                  {camp_sessions.theme_scripture_text
                    ? <p dangerouslySetInnerHTML={{__html: camp_sessions.theme_scripture_text}}/>
                    : <p>No data</p>
                  }
                </div>
              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

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

              

              

              

              

              

              

              
              

              

              

              

              

              

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

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>DayCampHours</p>
                    <p>{camp_sessions?.day_camp_hours}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ThirdShiftHours</p>
                    <p>{camp_sessions?.third_shift_hours}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

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

              

              

              
              

              

              

              

              

              

              

              

              

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

              

              

              

              
              

                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Weekly_themes CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>WeekNumber</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Tagline</th>
                                
                                
                                
                                <th>WeekStart</th>
                                
                                
                                
                                <th>WeekEnd</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.weekly_themes_camp_session && Array.isArray(camp_sessions.weekly_themes_camp_session) &&
                              camp_sessions.weekly_themes_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/weekly_themes/weekly_themes-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="week_number">
                                        { item.week_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tagline">
                                        { item.tagline }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="start_datetime">
                                        { dataFormatter.dateTimeFormatter(item.start_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="end_datetime">
                                        { dataFormatter.dateTimeFormatter(item.end_datetime) }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.weekly_themes_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Pricing_plans CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>PlanName</th>
                                
                                
                                
                                <th>PlanType</th>
                                
                                
                                
                                <th>MonthlyTuition</th>
                                
                                
                                
                                
                                
                                <th>IncludesDinner</th>
                                
                                
                                
                                <th>IncludesMorningPickup</th>
                                
                                
                                
                                <th>IncludesAfternoonDrop-Off</th>
                                
                                
                                
                                <th>IncludesThirdShift</th>
                                
                                
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.pricing_plans_camp_session && Array.isArray(camp_sessions.pricing_plans_camp_session) &&
                              camp_sessions.pricing_plans_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/pricing_plans/pricing_plans-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="plan_type">
                                        { item.plan_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="monthly_tuition">
                                        { item.monthly_tuition }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="includes_dinner">
                                        { dataFormatter.booleanFormatter(item.includes_dinner) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="includes_pickup">
                                        { dataFormatter.booleanFormatter(item.includes_pickup) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="includes_dropoff">
                                        { dataFormatter.booleanFormatter(item.includes_dropoff) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="includes_third_shift">
                                        { dataFormatter.booleanFormatter(item.includes_third_shift) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.pricing_plans_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Fee_rules CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>FeeRuleName</th>
                                
                                
                                
                                <th>FeeKind</th>
                                
                                
                                
                                <th>Amount</th>
                                
                                
                                
                                <th>WaiverFirstNRegistrations</th>
                                
                                
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.fee_rules_camp_session && Array.isArray(camp_sessions.fee_rules_camp_session) &&
                              camp_sessions.fee_rules_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/fee_rules/fee_rules-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="fee_kind">
                                        { item.fee_kind }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="amount">
                                        { item.amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="waiver_first_n">
                                        { item.waiver_first_n }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.fee_rules_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Enrollments CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>SubmittedAt</th>
                                
                                
                                
                                <th>EnrollmentStatus</th>
                                
                                
                                
                                <th>ApplicationFeeWaived</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.enrollments_camp_session && Array.isArray(camp_sessions.enrollments_camp_session) &&
                              camp_sessions.enrollments_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/enrollments/enrollments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="submitted_datetime">
                                        { dataFormatter.dateTimeFormatter(item.submitted_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="application_fee_waived">
                                        { dataFormatter.booleanFormatter(item.application_fee_waived) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.enrollments_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Waiver_documents CampSession</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>DocumentType</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Required</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.waiver_documents_camp_session && Array.isArray(camp_sessions.waiver_documents_camp_session) &&
                              camp_sessions.waiver_documents_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/waiver_documents/waiver_documents-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="document_type">
                                        { item.document_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_required">
                                        { dataFormatter.booleanFormatter(item.is_required) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.waiver_documents_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Field_trip_events CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>DepartTime</th>
                                
                                
                                
                                <th>ReturnTime</th>
                                
                                
                                
                                <th>PricePerStudent</th>
                                
                                
                                
                                <th>Capacity</th>
                                
                                
                                
                                <th>EventStatus</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.field_trip_events_camp_session && Array.isArray(camp_sessions.field_trip_events_camp_session) &&
                              camp_sessions.field_trip_events_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/field_trip_events/field_trip_events-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="depart_datetime">
                                        { dataFormatter.dateTimeFormatter(item.depart_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="return_datetime">
                                        { dataFormatter.dateTimeFormatter(item.return_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price_per_student">
                                        { item.price_per_student }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.field_trip_events_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Special_trips CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>SpecialTripName</th>
                                
                                
                                
                                <th>TripType</th>
                                
                                
                                
                                <th>Destination</th>
                                
                                
                                
                                <th>StartDate</th>
                                
                                
                                
                                <th>EndDate</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>SeparatePaymentRequired</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.special_trips_camp_session && Array.isArray(camp_sessions.special_trips_camp_session) &&
                              camp_sessions.special_trips_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/special_trips/special_trips-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="trip_type">
                                        { item.trip_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="destination">
                                        { item.destination }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="start_datetime">
                                        { dataFormatter.dateTimeFormatter(item.start_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="end_datetime">
                                        { dataFormatter.dateTimeFormatter(item.end_datetime) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="separate_payment_required">
                                        { dataFormatter.booleanFormatter(item.separate_payment_required) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.special_trips_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>End_of_summer_trip_options CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>OptionName</th>
                                
                                
                                
                                <th>OptionType</th>
                                
                                
                                
                                <th>Destination</th>
                                
                                
                                
                                
                                
                                <th>EstimatedPrice</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.end_of_summer_trip_options_camp_session && Array.isArray(camp_sessions.end_of_summer_trip_options_camp_session) &&
                              camp_sessions.end_of_summer_trip_options_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/end_of_summer_trip_options/end_of_summer_trip_options-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="option_type">
                                        { item.option_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="destination">
                                        { item.destination }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="estimated_price">
                                        { item.estimated_price }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.end_of_summer_trip_options_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Activity_blocks CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>BlockName</th>
                                
                                
                                
                                <th>ProgramShift</th>
                                
                                
                                
                                <th>BlockStart</th>
                                
                                
                                
                                <th>BlockEnd</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>BlockType</th>
                                
                                
                                
                                <th>Details</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.activity_blocks_camp_session && Array.isArray(camp_sessions.activity_blocks_camp_session) &&
                              camp_sessions.activity_blocks_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/activity_blocks/activity_blocks-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="program_shift">
                                        { item.program_shift }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="block_start_datetime">
                                        { dataFormatter.dateTimeFormatter(item.block_start_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="block_end_datetime">
                                        { dataFormatter.dateTimeFormatter(item.block_end_datetime) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="block_type">
                                        { item.block_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="details">
                                        { item.details }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.activity_blocks_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Staff_assignments CampSession</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>AssignmentRole</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.staff_assignments_camp_session && Array.isArray(camp_sessions.staff_assignments_camp_session) &&
                              camp_sessions.staff_assignments_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/staff_assignments/staff_assignments-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="assignment_role">
                                        { item.assignment_role }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.staff_assignments_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Announcements CampSession</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>Audience</th>
                                
                                
                                
                                
                                
                                <th>PublishAt</th>
                                
                                
                                
                                <th>ExpireAt</th>
                                
                                
                                
                                <th>Published</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {camp_sessions.announcements_camp_session && Array.isArray(camp_sessions.announcements_camp_session) &&
                              camp_sessions.announcements_camp_session.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/announcements/announcements-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="audience">
                                        { item.audience }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="publish_datetime">
                                        { dataFormatter.dateTimeFormatter(item.publish_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="expire_datetime">
                                        { dataFormatter.dateTimeFormatter(item.expire_datetime) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_published">
                                        { dataFormatter.booleanFormatter(item.is_published) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!camp_sessions?.announcements_camp_session?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

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

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

export default Camp_sessionsView;