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/properties/propertiesSlice'
import dataFormatter from '../../helpers/dataFormatter';
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 PropertiesView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { properties } = useAppSelector((state) => state.properties)

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

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

                <>
                    <p className={'block font-bold mb-2'}>Users Properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>First Name</th>

                                <th>Last Name</th>

                                <th>Phone Number</th>

                                <th>E-Mail</th>

                                <th>Disabled</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.users_properties && Array.isArray(properties.users_properties) &&
                              properties.users_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/users/users-view/?id=${item.id}`)}>

                                    <td data-label="firstName">
                                        { item.firstName }
                                    </td>

                                    <td data-label="lastName">
                                        { item.lastName }
                                    </td>

                                    <td data-label="phoneNumber">
                                        { item.phoneNumber }
                                    </td>

                                    <td data-label="email">
                                        { item.email }
                                    </td>

                                    <td data-label="disabled">
                                        { dataFormatter.booleanFormatter(item.disabled) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.users_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Audit_logs Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Action</th>

                                <th>Entity</th>

                                <th>EntityID</th>

                                <th>DiffJSON</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.audit_logs_property && Array.isArray(properties.audit_logs_property) &&
                              properties.audit_logs_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/audit_logs/audit_logs-view/?id=${item.id}`)}>

                                    <td data-label="action">
                                        { item.action }
                                    </td>

                                    <td data-label="entity">
                                        { item.entity }
                                    </td>

                                    <td data-label="entity_id">
                                        { item.entity_id }
                                    </td>

                                    <td data-label="diff_json">
                                        { item.diff_json }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.audit_logs_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Audit_logs properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Action</th>

                                <th>Entity</th>

                                <th>EntityID</th>

                                <th>DiffJSON</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.audit_logs_properties && Array.isArray(properties.audit_logs_properties) &&
                              properties.audit_logs_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/audit_logs/audit_logs-view/?id=${item.id}`)}>

                                    <td data-label="action">
                                        { item.action }
                                    </td>

                                    <td data-label="entity">
                                        { item.entity }
                                    </td>

                                    <td data-label="entity_id">
                                        { item.entity_id }
                                    </td>

                                    <td data-label="diff_json">
                                        { item.diff_json }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.audit_logs_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Beds Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>IsBunk</th>

                                <th>IsLower</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.beds_property && Array.isArray(properties.beds_property) &&
                              properties.beds_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/beds/beds-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="is_bunk">
                                        { dataFormatter.booleanFormatter(item.is_bunk) }
                                    </td>

                                    <td data-label="is_lower">
                                        { dataFormatter.booleanFormatter(item.is_lower) }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.beds_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Beds properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>IsBunk</th>

                                <th>IsLower</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.beds_properties && Array.isArray(properties.beds_properties) &&
                              properties.beds_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/beds/beds-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="is_bunk">
                                        { dataFormatter.booleanFormatter(item.is_bunk) }
                                    </td>

                                    <td data-label="is_lower">
                                        { dataFormatter.booleanFormatter(item.is_lower) }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.beds_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Booking_beds properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Date</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.booking_beds_properties && Array.isArray(properties.booking_beds_properties) &&
                              properties.booking_beds_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/booking_beds/booking_beds-view/?id=${item.id}`)}>

                                    <td data-label="date">
                                        { dataFormatter.dateTimeFormatter(item.date) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.booking_beds_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Booking_upsells properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Quantity</th>

                                <th>UnitPrice</th>

                                <th>Currency</th>

                                <th>ScheduledFor</th>

                                <th>Status</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.booking_upsells_properties && Array.isArray(properties.booking_upsells_properties) &&
                              properties.booking_upsells_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/booking_upsells/booking_upsells-view/?id=${item.id}`)}>

                                    <td data-label="quantity">
                                        { item.quantity }
                                    </td>

                                    <td data-label="unit_price">
                                        { item.unit_price }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="scheduled_for">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_for) }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.booking_upsells_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Bookings Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>Status</th>

                                <th>Check-inDate</th>

                                <th>Check-outDate</th>

                                <th>GuestsCount</th>

                                <th>TotalAmount</th>

                                <th>Currency</th>

                                <th>PaymentStatus</th>

                                <th>StripePaymentIntentID</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.bookings_property && Array.isArray(properties.bookings_property) &&
                              properties.bookings_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bookings/bookings-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="checkin_date">
                                        { dataFormatter.dateTimeFormatter(item.checkin_date) }
                                    </td>

                                    <td data-label="checkout_date">
                                        { dataFormatter.dateTimeFormatter(item.checkout_date) }
                                    </td>

                                    <td data-label="guests_count">
                                        { item.guests_count }
                                    </td>

                                    <td data-label="total_amount">
                                        { item.total_amount }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="payment_status">
                                        { item.payment_status }
                                    </td>

                                    <td data-label="stripe_payment_intent_id">
                                        { item.stripe_payment_intent_id }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.bookings_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Bookings properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>Status</th>

                                <th>Check-inDate</th>

                                <th>Check-outDate</th>

                                <th>GuestsCount</th>

                                <th>TotalAmount</th>

                                <th>Currency</th>

                                <th>PaymentStatus</th>

                                <th>StripePaymentIntentID</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.bookings_properties && Array.isArray(properties.bookings_properties) &&
                              properties.bookings_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bookings/bookings-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="checkin_date">
                                        { dataFormatter.dateTimeFormatter(item.checkin_date) }
                                    </td>

                                    <td data-label="checkout_date">
                                        { dataFormatter.dateTimeFormatter(item.checkout_date) }
                                    </td>

                                    <td data-label="guests_count">
                                        { item.guests_count }
                                    </td>

                                    <td data-label="total_amount">
                                        { item.total_amount }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="payment_status">
                                        { item.payment_status }
                                    </td>

                                    <td data-label="stripe_payment_intent_id">
                                        { item.stripe_payment_intent_id }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.bookings_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Coupons Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>Type</th>

                                <th>Value</th>

                                <th>Currency</th>

                                <th>StartsAt</th>

                                <th>EndsAt</th>

                                <th>MaxRedemptions</th>

                                <th>TimesRedeemed</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.coupons_property && Array.isArray(properties.coupons_property) &&
                              properties.coupons_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/coupons/coupons-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="type">
                                        { item.type }
                                    </td>

                                    <td data-label="value">
                                        { item.value }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="starts_at">
                                        { dataFormatter.dateTimeFormatter(item.starts_at) }
                                    </td>

                                    <td data-label="ends_at">
                                        { dataFormatter.dateTimeFormatter(item.ends_at) }
                                    </td>

                                    <td data-label="max_redemptions">
                                        { item.max_redemptions }
                                    </td>

                                    <td data-label="times_redeemed">
                                        { item.times_redeemed }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.coupons_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Coupons properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>Type</th>

                                <th>Value</th>

                                <th>Currency</th>

                                <th>StartsAt</th>

                                <th>EndsAt</th>

                                <th>MaxRedemptions</th>

                                <th>TimesRedeemed</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.coupons_properties && Array.isArray(properties.coupons_properties) &&
                              properties.coupons_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/coupons/coupons-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="type">
                                        { item.type }
                                    </td>

                                    <td data-label="value">
                                        { item.value }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="starts_at">
                                        { dataFormatter.dateTimeFormatter(item.starts_at) }
                                    </td>

                                    <td data-label="ends_at">
                                        { dataFormatter.dateTimeFormatter(item.ends_at) }
                                    </td>

                                    <td data-label="max_redemptions">
                                        { item.max_redemptions }
                                    </td>

                                    <td data-label="times_redeemed">
                                        { item.times_redeemed }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.coupons_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Event_orders Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>TotalAmount</th>

                                <th>Currency</th>

                                <th>PaymentStatus</th>

                                <th>StripePaymentIntentID</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.event_orders_property && Array.isArray(properties.event_orders_property) &&
                              properties.event_orders_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/event_orders/event_orders-view/?id=${item.id}`)}>

                                    <td data-label="total_amount">
                                        { item.total_amount }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="payment_status">
                                        { item.payment_status }
                                    </td>

                                    <td data-label="stripe_payment_intent_id">
                                        { item.stripe_payment_intent_id }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.event_orders_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Event_orders properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>TotalAmount</th>

                                <th>Currency</th>

                                <th>PaymentStatus</th>

                                <th>StripePaymentIntentID</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.event_orders_properties && Array.isArray(properties.event_orders_properties) &&
                              properties.event_orders_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/event_orders/event_orders-view/?id=${item.id}`)}>

                                    <td data-label="total_amount">
                                        { item.total_amount }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="payment_status">
                                        { item.payment_status }
                                    </td>

                                    <td data-label="stripe_payment_intent_id">
                                        { item.stripe_payment_intent_id }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.event_orders_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Event_ticket_types properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Price</th>

                                <th>Currency</th>

                                <th>CapacityOverrides</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.event_ticket_types_properties && Array.isArray(properties.event_ticket_types_properties) &&
                              properties.event_ticket_types_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/event_ticket_types/event_ticket_types-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="price">
                                        { item.price }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="capacity_overrides">
                                        { item.capacity_overrides }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.event_ticket_types_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Event_tickets properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Code</th>

                                <th>Status</th>

                                <th>QRSVG</th>

                                <th>IssuedToName</th>

                                <th>IssuedToEmail</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.event_tickets_properties && Array.isArray(properties.event_tickets_properties) &&
                              properties.event_tickets_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/event_tickets/event_tickets-view/?id=${item.id}`)}>

                                    <td data-label="code">
                                        { item.code }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="qr_svg">
                                        { item.qr_svg }
                                    </td>

                                    <td data-label="issued_to_name">
                                        { item.issued_to_name }
                                    </td>

                                    <td data-label="issued_to_email">
                                        { item.issued_to_email }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.event_tickets_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Events Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>StartAt</th>

                                <th>EndAt</th>

                                <th>Capacity</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.events_property && Array.isArray(properties.events_property) &&
                              properties.events_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/events/events-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="start_at">
                                        { dataFormatter.dateTimeFormatter(item.start_at) }
                                    </td>

                                    <td data-label="end_at">
                                        { dataFormatter.dateTimeFormatter(item.end_at) }
                                    </td>

                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.events_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Events properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>StartAt</th>

                                <th>EndAt</th>

                                <th>Capacity</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.events_properties && Array.isArray(properties.events_properties) &&
                              properties.events_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/events/events-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="start_at">
                                        { dataFormatter.dateTimeFormatter(item.start_at) }
                                    </td>

                                    <td data-label="end_at">
                                        { dataFormatter.dateTimeFormatter(item.end_at) }
                                    </td>

                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.events_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Housekeeping_tasks Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>DueDate</th>

                                <th>TaskType</th>

                                <th>Status</th>

                                <th>Notes</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.housekeeping_tasks_property && Array.isArray(properties.housekeeping_tasks_property) &&
                              properties.housekeeping_tasks_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/housekeeping_tasks/housekeeping_tasks-view/?id=${item.id}`)}>

                                    <td data-label="due_date">
                                        { dataFormatter.dateTimeFormatter(item.due_date) }
                                    </td>

                                    <td data-label="task_type">
                                        { item.task_type }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="notes">
                                        { item.notes }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.housekeeping_tasks_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Housekeeping_tasks properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>DueDate</th>

                                <th>TaskType</th>

                                <th>Status</th>

                                <th>Notes</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.housekeeping_tasks_properties && Array.isArray(properties.housekeeping_tasks_properties) &&
                              properties.housekeeping_tasks_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/housekeeping_tasks/housekeeping_tasks-view/?id=${item.id}`)}>

                                    <td data-label="due_date">
                                        { dataFormatter.dateTimeFormatter(item.due_date) }
                                    </td>

                                    <td data-label="task_type">
                                        { item.task_type }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="notes">
                                        { item.notes }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.housekeeping_tasks_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Inventory_dates Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Date</th>

                                <th>AllotedBeds</th>

                                <th>ClosedforArrival</th>

                                <th>ClosedforDeparture</th>

                                <th>OverridePrice</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.inventory_dates_property && Array.isArray(properties.inventory_dates_property) &&
                              properties.inventory_dates_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inventory_dates/inventory_dates-view/?id=${item.id}`)}>

                                    <td data-label="date">
                                        { dataFormatter.dateTimeFormatter(item.date) }
                                    </td>

                                    <td data-label="alloted_beds">
                                        { item.alloted_beds }
                                    </td>

                                    <td data-label="closed_for_arrival">
                                        { dataFormatter.booleanFormatter(item.closed_for_arrival) }
                                    </td>

                                    <td data-label="closed_for_departure">
                                        { dataFormatter.booleanFormatter(item.closed_for_departure) }
                                    </td>

                                    <td data-label="override_price">
                                        { item.override_price }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.inventory_dates_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Inventory_dates properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Date</th>

                                <th>AllotedBeds</th>

                                <th>ClosedforArrival</th>

                                <th>ClosedforDeparture</th>

                                <th>OverridePrice</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.inventory_dates_properties && Array.isArray(properties.inventory_dates_properties) &&
                              properties.inventory_dates_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inventory_dates/inventory_dates-view/?id=${item.id}`)}>

                                    <td data-label="date">
                                        { dataFormatter.dateTimeFormatter(item.date) }
                                    </td>

                                    <td data-label="alloted_beds">
                                        { item.alloted_beds }
                                    </td>

                                    <td data-label="closed_for_arrival">
                                        { dataFormatter.booleanFormatter(item.closed_for_arrival) }
                                    </td>

                                    <td data-label="closed_for_departure">
                                        { dataFormatter.booleanFormatter(item.closed_for_departure) }
                                    </td>

                                    <td data-label="override_price">
                                        { item.override_price }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.inventory_dates_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Maintenance_tickets Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Priority</th>

                                <th>Status</th>

                                <th>Title</th>

                                <th>Description</th>

                                <th>PhotosJSON</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.maintenance_tickets_property && Array.isArray(properties.maintenance_tickets_property) &&
                              properties.maintenance_tickets_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/maintenance_tickets/maintenance_tickets-view/?id=${item.id}`)}>

                                    <td data-label="priority">
                                        { item.priority }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="title">
                                        { item.title }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="photos_json">
                                        { item.photos_json }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.maintenance_tickets_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Maintenance_tickets properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Priority</th>

                                <th>Status</th>

                                <th>Title</th>

                                <th>Description</th>

                                <th>PhotosJSON</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.maintenance_tickets_properties && Array.isArray(properties.maintenance_tickets_properties) &&
                              properties.maintenance_tickets_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/maintenance_tickets/maintenance_tickets-view/?id=${item.id}`)}>

                                    <td data-label="priority">
                                        { item.priority }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                    <td data-label="title">
                                        { item.title }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="photos_json">
                                        { item.photos_json }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.maintenance_tickets_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Message_threads Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Subject</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.message_threads_property && Array.isArray(properties.message_threads_property) &&
                              properties.message_threads_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/message_threads/message_threads-view/?id=${item.id}`)}>

                                    <td data-label="subject">
                                        { item.subject }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.message_threads_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Message_threads properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Subject</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.message_threads_properties && Array.isArray(properties.message_threads_properties) &&
                              properties.message_threads_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/message_threads/message_threads-view/?id=${item.id}`)}>

                                    <td data-label="subject">
                                        { item.subject }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.message_threads_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Messages properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>SenderType</th>

                                <th>Body</th>

                                <th>AttachmentsJSON</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.messages_properties && Array.isArray(properties.messages_properties) &&
                              properties.messages_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/messages/messages-view/?id=${item.id}`)}>

                                    <td data-label="sender_type">
                                        { item.sender_type }
                                    </td>

                                    <td data-label="body">
                                        { item.body }
                                    </td>

                                    <td data-label="attachments_json">
                                        { item.attachments_json }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.messages_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Payments properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>StripePaymentIntentID</th>

                                <th>Amount</th>

                                <th>Currency</th>

                                <th>Status</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.payments_properties && Array.isArray(properties.payments_properties) &&
                              properties.payments_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/payments/payments-view/?id=${item.id}`)}>

                                    <td data-label="stripe_payment_intent_id">
                                        { item.stripe_payment_intent_id }
                                    </td>

                                    <td data-label="amount">
                                        { item.amount }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="status">
                                        { item.status }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.payments_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Reviews Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Rating</th>

                                <th>Title</th>

                                <th>Body</th>

                                <th>IsPublic</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.reviews_property && Array.isArray(properties.reviews_property) &&
                              properties.reviews_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/reviews/reviews-view/?id=${item.id}`)}>

                                    <td data-label="rating">
                                        { item.rating }
                                    </td>

                                    <td data-label="title">
                                        { item.title }
                                    </td>

                                    <td data-label="body">
                                        { item.body }
                                    </td>

                                    <td data-label="is_public">
                                        { dataFormatter.booleanFormatter(item.is_public) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.reviews_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Reviews properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Rating</th>

                                <th>Title</th>

                                <th>Body</th>

                                <th>IsPublic</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.reviews_properties && Array.isArray(properties.reviews_properties) &&
                              properties.reviews_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/reviews/reviews-view/?id=${item.id}`)}>

                                    <td data-label="rating">
                                        { item.rating }
                                    </td>

                                    <td data-label="title">
                                        { item.title }
                                    </td>

                                    <td data-label="body">
                                        { item.body }
                                    </td>

                                    <td data-label="is_public">
                                        { dataFormatter.booleanFormatter(item.is_public) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.reviews_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Room_types Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>Capacity</th>

                                <th>GenderPolicy</th>

                                <th>AmenitiesJSON</th>

                                <th>BasePrice</th>

                                <th>IsPrivate</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.room_types_property && Array.isArray(properties.room_types_property) &&
                              properties.room_types_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/room_types/room_types-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>

                                    <td data-label="gender_policy">
                                        { item.gender_policy }
                                    </td>

                                    <td data-label="amenities_json">
                                        { item.amenities_json }
                                    </td>

                                    <td data-label="base_price">
                                        { item.base_price }
                                    </td>

                                    <td data-label="is_private">
                                        { dataFormatter.booleanFormatter(item.is_private) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.room_types_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Room_types properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>Capacity</th>

                                <th>GenderPolicy</th>

                                <th>AmenitiesJSON</th>

                                <th>BasePrice</th>

                                <th>IsPrivate</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.room_types_properties && Array.isArray(properties.room_types_properties) &&
                              properties.room_types_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/room_types/room_types-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="capacity">
                                        { item.capacity }
                                    </td>

                                    <td data-label="gender_policy">
                                        { item.gender_policy }
                                    </td>

                                    <td data-label="amenities_json">
                                        { item.amenities_json }
                                    </td>

                                    <td data-label="base_price">
                                        { item.base_price }
                                    </td>

                                    <td data-label="is_private">
                                        { dataFormatter.booleanFormatter(item.is_private) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.room_types_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Rooms Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Floor</th>

                                <th>Notes</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.rooms_property && Array.isArray(properties.rooms_property) &&
                              properties.rooms_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/rooms/rooms-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="floor">
                                        { item.floor }
                                    </td>

                                    <td data-label="notes">
                                        { item.notes }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.rooms_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Rooms properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Floor</th>

                                <th>Notes</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.rooms_properties && Array.isArray(properties.rooms_properties) &&
                              properties.rooms_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/rooms/rooms-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="floor">
                                        { item.floor }
                                    </td>

                                    <td data-label="notes">
                                        { item.notes }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.rooms_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Upsells Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>Price</th>

                                <th>Currency</th>

                                <th>Taxable</th>

                                <th>RequiresDateTime</th>

                                <th>Stock</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.upsells_property && Array.isArray(properties.upsells_property) &&
                              properties.upsells_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/upsells/upsells-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="price">
                                        { item.price }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="taxable">
                                        { dataFormatter.booleanFormatter(item.taxable) }
                                    </td>

                                    <td data-label="requires_date_time">
                                        { dataFormatter.booleanFormatter(item.requires_date_time) }
                                    </td>

                                    <td data-label="stock">
                                        { item.stock }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.upsells_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>Upsells properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                                <th>Name</th>

                                <th>Description</th>

                                <th>Price</th>

                                <th>Currency</th>

                                <th>Taxable</th>

                                <th>RequiresDateTime</th>

                                <th>Stock</th>

                                <th>IsActive</th>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.upsells_properties && Array.isArray(properties.upsells_properties) &&
                              properties.upsells_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/upsells/upsells-view/?id=${item.id}`)}>

                                    <td data-label="name">
                                        { item.name }
                                    </td>

                                    <td data-label="description">
                                        { item.description }
                                    </td>

                                    <td data-label="price">
                                        { item.price }
                                    </td>

                                    <td data-label="currency">
                                        { item.currency }
                                    </td>

                                    <td data-label="taxable">
                                        { dataFormatter.booleanFormatter(item.taxable) }
                                    </td>

                                    <td data-label="requires_date_time">
                                        { dataFormatter.booleanFormatter(item.requires_date_time) }
                                    </td>

                                    <td data-label="stock">
                                        { item.stock }
                                    </td>

                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.upsells_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>User_roles Property</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.user_roles_property && Array.isArray(properties.user_roles_property) &&
                              properties.user_roles_property.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_roles/user_roles-view/?id=${item.id}`)}>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.user_roles_property?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <>
                    <p className={'block font-bold mb-2'}>User_roles properties</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>

                            </tr>
                            </thead>
                            <tbody>
                            {properties.user_roles_properties && Array.isArray(properties.user_roles_properties) &&
                              properties.user_roles_properties.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/user_roles/user_roles-view/?id=${item.id}`)}>

                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!properties?.user_roles_properties?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>

                <BaseDivider />

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

PropertiesView.getLayout = function getLayout(page: ReactElement) {
    return (
      <LayoutAuthenticated>
          {page}
      </LayoutAuthenticated>
    )
}

export default PropertiesView;
