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/creator_profiles/creator_profilesSlice'
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 Creator_profilesView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { creator_profiles } = useAppSelector((state) => state.creator_profiles)
    
    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 creator_profiles')}</title>
          </Head>
          <SectionMain>
            <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title={removeLastCharacter('View creator_profiles')} main>
                <BaseButton
                  color='info'
                  label='Edit'
                  href={`/creator_profiles/creator_profiles-edit/?id=${id}`}
                />
            </SectionTitleLineWithButton>
            <CardBox>
            

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>User</p>
                    
                    
                        <p>{creator_profiles?.user?.firstName ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Handle</p>
                    <p>{creator_profiles?.handle}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>CreatorType</p>
                    <p>{creator_profiles?.creator_type ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

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

              

              

              

              
              

              

              

              

              

              

              

              

              

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

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Slogan</p>
                    <p>{creator_profiles?.slogan}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

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

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>BusinessEmail</p>
                    <p>{creator_profiles?.business_email}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>SupportEmail</p>
                    <p>{creator_profiles?.support_email}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>PreferredLanguage</p>
                    <p>{creator_profiles?.preferred_language}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>CategoryTags(Comma-separated)</p>
                    <p>{creator_profiles?.category_tags}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>ProfileStyle</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{creator_profiles?.profile_style?.style_name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>TipPage</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{creator_profiles?.tip_page?.slug ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>MerchStore</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{creator_profiles?.merch_store?.store_name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

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

              

              

              
              

                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Follows FollowedCreator</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>
                            {creator_profiles.follows_followed_creator && Array.isArray(creator_profiles.follows_followed_creator) &&
                              creator_profiles.follows_followed_creator.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>
                        {!creator_profiles?.follows_followed_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Discovery_items Creator</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>
                            {creator_profiles.discovery_items_creator && Array.isArray(creator_profiles.discovery_items_creator) &&
                              creator_profiles.discovery_items_creator.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>
                        {!creator_profiles?.discovery_items_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Streams Creator</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>
                            {creator_profiles.streams_creator && Array.isArray(creator_profiles.streams_creator) &&
                              creator_profiles.streams_creator.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>
                        {!creator_profiles?.streams_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Videos Creator</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>
                            {creator_profiles.videos_creator && Array.isArray(creator_profiles.videos_creator) &&
                              creator_profiles.videos_creator.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>
                        {!creator_profiles?.videos_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Tip_pages Creator</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>
                            {creator_profiles.tip_pages_creator && Array.isArray(creator_profiles.tip_pages_creator) &&
                              creator_profiles.tip_pages_creator.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>
                        {!creator_profiles?.tip_pages_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Alerts Creator</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>
                            {creator_profiles.alerts_creator && Array.isArray(creator_profiles.alerts_creator) &&
                              creator_profiles.alerts_creator.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>
                        {!creator_profiles?.alerts_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Overlay_profiles Creator</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>
                            {creator_profiles.overlay_profiles_creator && Array.isArray(creator_profiles.overlay_profiles_creator) &&
                              creator_profiles.overlay_profiles_creator.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>
                        {!creator_profiles?.overlay_profiles_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Merch_stores Creator</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>
                            {creator_profiles.merch_stores_creator && Array.isArray(creator_profiles.merch_stores_creator) &&
                              creator_profiles.merch_stores_creator.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>
                        {!creator_profiles?.merch_stores_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Private_mailboxes OwnerCreator</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>
                            {creator_profiles.private_mailboxes_owner_creator && Array.isArray(creator_profiles.private_mailboxes_owner_creator) &&
                              creator_profiles.private_mailboxes_owner_creator.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>
                        {!creator_profiles?.private_mailboxes_owner_creator?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                

                <BaseDivider />

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

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

export default Creator_profilesView;