import React, { ReactElement, useEffect } from 'react';
import Head from 'next/head'
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import dayjs from "dayjs";
import {useAppDispatch, useAppSelector} from "../../stores/hooks";
import {useRouter} from "next/router";
import { fetch } from '../../stores/organizations/organizationsSlice'
import {saveFile} from "../../helpers/fileSaver";
import dataFormatter from '../../helpers/dataFormatter';
import ImageField from "../../components/ImageField";
import LayoutAuthenticated from "../../layouts/Authenticated";
import {getPageTitle} from "../../config";
import SectionTitleLineWithButton from "../../components/SectionTitleLineWithButton";
import SectionMain from "../../components/SectionMain";
import CardBox from "../../components/CardBox";
import BaseButton from "../../components/BaseButton";
import BaseDivider from "../../components/BaseDivider";
import {mdiChartTimelineVariant} from "@mdi/js";
import {SwitchField} from "../../components/SwitchField";
import FormField from "../../components/FormField";

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


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

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

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


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

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

              

              

              

              

              

              

              

              

              

              

              

              
              

                
                <>
                    <p className={'block font-bold mb-2'}>Users Organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>First Name</th>
                                
                                
                                
                                <th>Last Name</th>
                                
                                
                                
                                <th>Phone Number</th>
                                
                                
                                
                                <th>E-Mail</th>
                                
                                
                                
                                <th>Disabled</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.users_organizations && Array.isArray(organizations.users_organizations) &&
                              organizations.users_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/users/users-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="firstName">
                                        { item.firstName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lastName">
                                        { item.lastName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phoneNumber">
                                        { item.phoneNumber }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="disabled">
                                        { dataFormatter.booleanFormatter(item.disabled) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.users_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Creator_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Handle</th>
                                
                                
                                
                                <th>CreatorType</th>
                                
                                
                                
                                <th>IsVerified</th>
                                
                                
                                
                                <th>IsAdultCreator</th>
                                
                                
                                
                                <th>Slogan</th>
                                
                                
                                
                                
                                
                                <th>BusinessEmail</th>
                                
                                
                                
                                <th>SupportEmail</th>
                                
                                
                                
                                <th>PreferredLanguage</th>
                                
                                
                                
                                <th>CategoryTags(Comma-separated)</th>
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.creator_profiles_organizations && Array.isArray(organizations.creator_profiles_organizations) &&
                              organizations.creator_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/creator_profiles/creator_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="handle">
                                        { item.handle }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="creator_type">
                                        { item.creator_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_verified">
                                        { dataFormatter.booleanFormatter(item.is_verified) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_adult_creator">
                                        { dataFormatter.booleanFormatter(item.is_adult_creator) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="slogan">
                                        { item.slogan }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="business_email">
                                        { item.business_email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="support_email">
                                        { item.support_email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="preferred_language">
                                        { item.preferred_language }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="category_tags">
                                        { item.category_tags }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.creator_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Fan_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Nickname</th>
                                
                                
                                
                                
                                
                                <th>HideSocialActivity</th>
                                
                                
                                
                                <th>XPCoinsBalance</th>
                                
                                
                                
                                <th>AdultModeEnabled</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.fan_profiles_organizations && Array.isArray(organizations.fan_profiles_organizations) &&
                              organizations.fan_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/fan_profiles/fan_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="nickname">
                                        { item.nickname }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="hide_social_activity">
                                        { dataFormatter.booleanFormatter(item.hide_social_activity) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="xp_coins_balance">
                                        { item.xp_coins_balance }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="adult_mode_enabled">
                                        { dataFormatter.booleanFormatter(item.adult_mode_enabled) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.fan_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Follows organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>FollowedAt</th>
                                
                                
                                
                                <th>NotificationsEnabled</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.follows_organizations && Array.isArray(organizations.follows_organizations) &&
                              organizations.follows_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/follows/follows-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="followed_at">
                                        { dataFormatter.dateTimeFormatter(item.followed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notifications_enabled">
                                        { dataFormatter.booleanFormatter(item.notifications_enabled) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.follows_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Theme_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Mode</th>
                                
                                
                                
                                <th>ThemeName</th>
                                
                                
                                
                                <th>PrimaryColorHex</th>
                                
                                
                                
                                <th>AccentColorHex</th>
                                
                                
                                
                                <th>NeonGlowColorHex</th>
                                
                                
                                
                                <th>RGBCycleEnabled</th>
                                
                                
                                
                                <th>RGBCycleSpeed</th>
                                
                                
                                
                                <th>HolidayPalette</th>
                                
                                
                                
                                <th>AdultPaletteEnabled</th>
                                
                                
                                
                                <th>AdultPrimaryColorHex</th>
                                
                                
                                
                                <th>AdultAccentColorHex</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.theme_profiles_organizations && Array.isArray(organizations.theme_profiles_organizations) &&
                              organizations.theme_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/theme_profiles/theme_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="mode">
                                        { item.mode }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="theme_name">
                                        { item.theme_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="primary_color_hex">
                                        { item.primary_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="accent_color_hex">
                                        { item.accent_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="neon_glow_color_hex">
                                        { item.neon_glow_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rgb_cycle_enabled">
                                        { dataFormatter.booleanFormatter(item.rgb_cycle_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rgb_cycle_speed">
                                        { item.rgb_cycle_speed }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="holiday_palette">
                                        { item.holiday_palette }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="adult_palette_enabled">
                                        { dataFormatter.booleanFormatter(item.adult_palette_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="adult_primary_color_hex">
                                        { item.adult_primary_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="adult_accent_color_hex">
                                        { item.adult_accent_color_hex }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.theme_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Profile_styles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>StyleName</th>
                                
                                
                                
                                <th>UsernameColorHex</th>
                                
                                
                                
                                <th>BioFontFamily</th>
                                
                                
                                
                                <th>PanelOrderJSON</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>ProfileLayout</th>
                                
                                
                                
                                <th>ShowPronounsBadge</th>
                                
                                
                                
                                <th>PronounsText</th>
                                
                                
                                
                                <th>CustomCSS</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.profile_styles_organizations && Array.isArray(organizations.profile_styles_organizations) &&
                              organizations.profile_styles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/profile_styles/profile_styles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="style_name">
                                        { item.style_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="username_color_hex">
                                        { item.username_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="bio_font_family">
                                        { item.bio_font_family }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="panel_order_json">
                                        { item.panel_order_json }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="profile_layout">
                                        { item.profile_layout }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="show_pronouns_badge">
                                        { dataFormatter.booleanFormatter(item.show_pronouns_badge) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="pronouns_text">
                                        { item.pronouns_text }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="custom_css">
                                        { item.custom_css }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.profile_styles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Discovery_items organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>ItemType</th>
                                
                                
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>Subtitle</th>
                                
                                
                                
                                
                                
                                <th>Score</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.discovery_items_organizations && Array.isArray(organizations.discovery_items_organizations) &&
                              organizations.discovery_items_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/discovery_items/discovery_items-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="item_type">
                                        { item.item_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="subtitle">
                                        { item.subtitle }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="score">
                                        { item.score }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.discovery_items_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Streams organizations</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>Category</th>
                                
                                
                                
                                <th>IsLive</th>
                                
                                
                                
                                <th>IsAdult</th>
                                
                                
                                
                                
                                
                                <th>ScheduledStartAt</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>EndedAt</th>
                                
                                
                                
                                <th>ViewerCount</th>
                                
                                
                                
                                <th>StreamKeyHint</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.streams_organizations && Array.isArray(organizations.streams_organizations) &&
                              organizations.streams_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/streams/streams-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="category">
                                        { item.category }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_live">
                                        { dataFormatter.booleanFormatter(item.is_live) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_adult">
                                        { dataFormatter.booleanFormatter(item.is_adult) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="scheduled_start_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ended_at">
                                        { dataFormatter.dateTimeFormatter(item.ended_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="viewer_count">
                                        { item.viewer_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stream_key_hint">
                                        { item.stream_key_hint }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.streams_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Videos organizations</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>Visibility</th>
                                
                                
                                
                                <th>IsAdult</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>PublishedAt</th>
                                
                                
                                
                                <th>DurationSeconds</th>
                                
                                
                                
                                <th>ViewCount</th>
                                
                                
                                
                                <th>LikeCount</th>
                                
                                
                                
                                <th>CommentCount</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.videos_organizations && Array.isArray(organizations.videos_organizations) &&
                              organizations.videos_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/videos/videos-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_adult">
                                        { dataFormatter.booleanFormatter(item.is_adult) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="published_at">
                                        { dataFormatter.dateTimeFormatter(item.published_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="duration_seconds">
                                        { item.duration_seconds }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="view_count">
                                        { item.view_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="like_count">
                                        { item.like_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="comment_count">
                                        { item.comment_count }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.videos_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Comments organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>TargetType</th>
                                
                                
                                
                                <th>TargetKey</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>PostedAt</th>
                                
                                
                                
                                <th>IsHidden</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.comments_organizations && Array.isArray(organizations.comments_organizations) &&
                              organizations.comments_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/comments/comments-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="target_type">
                                        { item.target_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_key">
                                        { item.target_key }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="posted_at">
                                        { dataFormatter.dateTimeFormatter(item.posted_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_hidden">
                                        { dataFormatter.booleanFormatter(item.is_hidden) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.comments_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Playlists organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>PlaylistName</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Visibility</th>
                                
                                
                                
                                <th>Collaborative</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.playlists_organizations && Array.isArray(organizations.playlists_organizations) &&
                              organizations.playlists_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/playlists/playlists-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="visibility">
                                        { item.visibility }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="collaborative">
                                        { dataFormatter.booleanFormatter(item.collaborative) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.playlists_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Playlist_items organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ItemType</th>
                                
                                
                                
                                <th>ItemKey</th>
                                
                                
                                
                                <th>Position</th>
                                
                                
                                
                                <th>AddedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.playlist_items_organizations && Array.isArray(organizations.playlist_items_organizations) &&
                              organizations.playlist_items_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/playlist_items/playlist_items-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="item_type">
                                        { item.item_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="item_key">
                                        { item.item_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="position">
                                        { item.position }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="added_at">
                                        { dataFormatter.dateTimeFormatter(item.added_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.playlist_items_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Tip_pages organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TipPageSlug</th>
                                
                                
                                
                                <th>Headline</th>
                                
                                
                                
                                
                                
                                <th>BackgroundType</th>
                                
                                
                                
                                <th>BackgroundValue</th>
                                
                                
                                
                                <th>AccentColorHex</th>
                                
                                
                                
                                <th>PresetAmount1</th>
                                
                                
                                
                                <th>PresetAmount2</th>
                                
                                
                                
                                <th>PresetAmount3</th>
                                
                                
                                
                                <th>AllowCustomAmount</th>
                                
                                
                                
                                <th>MinimumAmount</th>
                                
                                
                                
                                <th>TTSEnabled</th>
                                
                                
                                
                                <th>TTSVoice</th>
                                
                                
                                
                                <th>ShowSupporterFeed</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.tip_pages_organizations && Array.isArray(organizations.tip_pages_organizations) &&
                              organizations.tip_pages_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/tip_pages/tip_pages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="slug">
                                        { item.slug }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="headline">
                                        { item.headline }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="background_type">
                                        { item.background_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="background_value">
                                        { item.background_value }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="accent_color_hex">
                                        { item.accent_color_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="preset_amount_1">
                                        { item.preset_amount_1 }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="preset_amount_2">
                                        { item.preset_amount_2 }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="preset_amount_3">
                                        { item.preset_amount_3 }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="allow_custom_amount">
                                        { dataFormatter.booleanFormatter(item.allow_custom_amount) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="minimum_amount">
                                        { item.minimum_amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tts_enabled">
                                        { dataFormatter.booleanFormatter(item.tts_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tts_voice">
                                        { item.tts_voice }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="show_supporter_feed">
                                        { dataFormatter.booleanFormatter(item.show_supporter_feed) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.tip_pages_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Tips organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Amount</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                
                                
                                <th>IsAnonymous</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.tips_organizations && Array.isArray(organizations.tips_organizations) &&
                              organizations.tips_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/tips/tips-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="amount">
                                        { item.amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_anonymous">
                                        { dataFormatter.booleanFormatter(item.is_anonymous) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.tips_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Alert_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ProfileName</th>
                                
                                
                                
                                <th>BrandPrimaryHex</th>
                                
                                
                                
                                <th>BrandAccentHex</th>
                                
                                
                                
                                <th>AnimationStyle</th>
                                
                                
                                
                                
                                
                                <th>TTSEnabled</th>
                                
                                
                                
                                <th>TTSVoice</th>
                                
                                
                                
                                <th>TemplateStyle</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.alert_profiles_organizations && Array.isArray(organizations.alert_profiles_organizations) &&
                              organizations.alert_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/alert_profiles/alert_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="profile_name">
                                        { item.profile_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="brand_primary_hex">
                                        { item.brand_primary_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="brand_accent_hex">
                                        { item.brand_accent_hex }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="animation_style">
                                        { item.animation_style }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="tts_enabled">
                                        { dataFormatter.booleanFormatter(item.tts_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tts_voice">
                                        { item.tts_voice }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="template_style">
                                        { item.template_style }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.alert_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Alerts organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>AlertType</th>
                                
                                
                                
                                <th>Title</th>
                                
                                
                                
                                
                                
                                <th>Amount</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>CreatedAtTime</th>
                                
                                
                                
                                <th>ShownAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.alerts_organizations && Array.isArray(organizations.alerts_organizations) &&
                              organizations.alerts_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/alerts/alerts-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="alert_type">
                                        { item.alert_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="amount">
                                        { item.amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="created_at_time">
                                        { dataFormatter.dateTimeFormatter(item.created_at_time) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="shown_at">
                                        { dataFormatter.dateTimeFormatter(item.shown_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.alerts_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Overlay_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>OverlayName</th>
                                
                                
                                
                                <th>OverlayType</th>
                                
                                
                                
                                <th>AccessToken</th>
                                
                                
                                
                                <th>IsActive</th>
                                
                                
                                
                                <th>CanvasSettingsJSON</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.overlay_profiles_organizations && Array.isArray(organizations.overlay_profiles_organizations) &&
                              organizations.overlay_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/overlay_profiles/overlay_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="overlay_type">
                                        { item.overlay_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="access_token">
                                        { item.access_token }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="canvas_settings_json">
                                        { item.canvas_settings_json }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.overlay_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Widget_catalog_items organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>WidgetName</th>
                                
                                
                                
                                <th>IconName</th>
                                
                                
                                
                                <th>AuthorName</th>
                                
                                
                                
                                <th>WidgetType</th>
                                
                                
                                
                                
                                
                                <th>IsPublic</th>
                                
                                
                                
                                <th>IsAdultOnly</th>
                                
                                
                                
                                
                                
                                <th>SchemaJSON</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.widget_catalog_items_organizations && Array.isArray(organizations.widget_catalog_items_organizations) &&
                              organizations.widget_catalog_items_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/widget_catalog_items/widget_catalog_items-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="icon_name">
                                        { item.icon_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="author_name">
                                        { item.author_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="widget_type">
                                        { item.widget_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_public">
                                        { dataFormatter.booleanFormatter(item.is_public) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_adult_only">
                                        { dataFormatter.booleanFormatter(item.is_adult_only) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="schema_json">
                                        { item.schema_json }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.widget_catalog_items_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Overlay_widgets organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>InstanceName</th>
                                
                                
                                
                                <th>ConfigJSON</th>
                                
                                
                                
                                <th>X</th>
                                
                                
                                
                                <th>Y</th>
                                
                                
                                
                                <th>Width</th>
                                
                                
                                
                                <th>Height</th>
                                
                                
                                
                                <th>ZIndex</th>
                                
                                
                                
                                <th>IsVisible</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.overlay_widgets_organizations && Array.isArray(organizations.overlay_widgets_organizations) &&
                              organizations.overlay_widgets_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/overlay_widgets/overlay_widgets-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="instance_name">
                                        { item.instance_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="config_json">
                                        { item.config_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="x">
                                        { item.x }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="y">
                                        { item.y }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="width">
                                        { item.width }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="height">
                                        { item.height }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="z_index">
                                        { item.z_index }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_visible">
                                        { dataFormatter.booleanFormatter(item.is_visible) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.overlay_widgets_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Merch_stores organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>StoreName</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>IsActive</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.merch_stores_organizations && Array.isArray(organizations.merch_stores_organizations) &&
                              organizations.merch_stores_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/merch_stores/merch_stores-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="store_name">
                                        { item.store_name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.merch_stores_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Products organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ProductName</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>ProductType</th>
                                
                                
                                
                                <th>Price</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>StockQuantity</th>
                                
                                
                                
                                <th>IsActive</th>
                                
                                
                                
                                <th>IsAdult</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.products_organizations && Array.isArray(organizations.products_organizations) &&
                              organizations.products_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/products/products-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="product_type">
                                        { item.product_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price">
                                        { item.price }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stock_quantity">
                                        { item.stock_quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_adult">
                                        { dataFormatter.booleanFormatter(item.is_adult) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.products_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Product_variants organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>VariantName</th>
                                
                                
                                
                                <th>SKU</th>
                                
                                
                                
                                <th>PriceOverride</th>
                                
                                
                                
                                <th>StockQuantity</th>
                                
                                
                                
                                <th>AttributesJSON</th>
                                
                                
                                
                                <th>IsActive</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.product_variants_organizations && Array.isArray(organizations.product_variants_organizations) &&
                              organizations.product_variants_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/product_variants/product_variants-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="variant_name">
                                        { item.variant_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sku">
                                        { item.sku }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="price_override">
                                        { item.price_override }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="stock_quantity">
                                        { item.stock_quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="attributes_json">
                                        { item.attributes_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.product_variants_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Orders organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Subtotal</th>
                                
                                
                                
                                <th>ShippingCost</th>
                                
                                
                                
                                <th>TaxTotal</th>
                                
                                
                                
                                <th>Total</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>PaymentMethod</th>
                                
                                
                                
                                <th>PlacedAt</th>
                                
                                
                                
                                <th>PaidAt</th>
                                
                                
                                
                                <th>FulfilledAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.orders_organizations && Array.isArray(organizations.orders_organizations) &&
                              organizations.orders_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/orders/orders-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="subtotal">
                                        { item.subtotal }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="shipping_cost">
                                        { item.shipping_cost }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tax_total">
                                        { item.tax_total }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="total">
                                        { item.total }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="payment_method">
                                        { item.payment_method }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="placed_at">
                                        { dataFormatter.dateTimeFormatter(item.placed_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="paid_at">
                                        { dataFormatter.dateTimeFormatter(item.paid_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="fulfilled_at">
                                        { dataFormatter.dateTimeFormatter(item.fulfilled_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.orders_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Order_items organizations</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>LineTotal</th>
                                
                                
                                
                                <th>ProductNameSnapshot</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.order_items_organizations && Array.isArray(organizations.order_items_organizations) &&
                              organizations.order_items_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/order_items/order_items-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="quantity">
                                        { item.quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="unit_price">
                                        { item.unit_price }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="line_total">
                                        { item.line_total }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="product_name_snapshot">
                                        { item.product_name_snapshot }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.order_items_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Shipping_profiles organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>ProfileName</th>
                                
                                
                                
                                <th>OriginCountry</th>
                                
                                
                                
                                <th>OriginRegion</th>
                                
                                
                                
                                <th>OriginPostalCode</th>
                                
                                
                                
                                <th>RulesJSON</th>
                                
                                
                                
                                <th>IsActive</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.shipping_profiles_organizations && Array.isArray(organizations.shipping_profiles_organizations) &&
                              organizations.shipping_profiles_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/shipping_profiles/shipping_profiles-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="profile_name">
                                        { item.profile_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="origin_country">
                                        { item.origin_country }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="origin_region">
                                        { item.origin_region }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="origin_postal_code">
                                        { item.origin_postal_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="rules_json">
                                        { item.rules_json }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_active">
                                        { dataFormatter.booleanFormatter(item.is_active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.shipping_profiles_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Private_mailboxes organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>PublicLabel</th>
                                
                                
                                
                                <th>IsEnabled</th>
                                
                                
                                
                                <th>AllowAttachments</th>
                                
                                
                                
                                <th>DeliveryMode</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.private_mailboxes_organizations && Array.isArray(organizations.private_mailboxes_organizations) &&
                              organizations.private_mailboxes_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/private_mailboxes/private_mailboxes-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="public_label">
                                        { item.public_label }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="is_enabled">
                                        { dataFormatter.booleanFormatter(item.is_enabled) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="allow_attachments">
                                        { dataFormatter.booleanFormatter(item.allow_attachments) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="delivery_mode">
                                        { item.delivery_mode }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.private_mailboxes_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Messages organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Subject</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>SentAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.messages_organizations && Array.isArray(organizations.messages_organizations) &&
                              organizations.messages_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/messages/messages-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="subject">
                                        { item.subject }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sent_at">
                                        { dataFormatter.dateTimeFormatter(item.sent_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.messages_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Reports organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>TargetType</th>
                                
                                
                                
                                <th>TargetKey</th>
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ReportedAt</th>
                                
                                
                                
                                <th>ResolvedAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.reports_organizations && Array.isArray(organizations.reports_organizations) &&
                              organizations.reports_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/reports/reports-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="target_type">
                                        { item.target_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_key">
                                        { item.target_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reported_at">
                                        { dataFormatter.dateTimeFormatter(item.reported_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="resolved_at">
                                        { dataFormatter.dateTimeFormatter(item.resolved_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.reports_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Demo_wallets organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>AvailableBalance</th>
                                
                                
                                
                                <th>LifetimeEarned</th>
                                
                                
                                
                                <th>LifetimeSpent</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>PayoutsEnabled</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.demo_wallets_organizations && Array.isArray(organizations.demo_wallets_organizations) &&
                              organizations.demo_wallets_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/demo_wallets/demo_wallets-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="available_balance">
                                        { item.available_balance }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lifetime_earned">
                                        { item.lifetime_earned }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lifetime_spent">
                                        { item.lifetime_spent }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="payouts_enabled">
                                        { dataFormatter.booleanFormatter(item.payouts_enabled) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.demo_wallets_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Wallet_transactions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Direction</th>
                                
                                
                                
                                <th>Kind</th>
                                
                                
                                
                                <th>Amount</th>
                                
                                
                                
                                <th>Currency</th>
                                
                                
                                
                                <th>ReferenceKey</th>
                                
                                
                                
                                <th>Note</th>
                                
                                
                                
                                <th>OccurredAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.wallet_transactions_organizations && Array.isArray(organizations.wallet_transactions_organizations) &&
                              organizations.wallet_transactions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/wallet_transactions/wallet_transactions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="direction">
                                        { item.direction }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="kind">
                                        { item.kind }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="amount">
                                        { item.amount }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="currency">
                                        { item.currency }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reference_key">
                                        { item.reference_key }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="note">
                                        { item.note }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="occurred_at">
                                        { dataFormatter.dateTimeFormatter(item.occurred_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.wallet_transactions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

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

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

export default OrganizationsView;