'use client';
import React from 'react';
import SidebarTabs from '@/components/SidebarTabs';
import EmailSender from '@/components/Admin/EmailSender';
import InstantMessaging from '@/components/Admin/InstantMessaging';
import AnnouncementScheduler from '@/components/Admin/AnnouncementScheduler';
import logger from '@/utils/logger';

export default function MessageriePage({ csrfToken }) {
  const tabs = [
    {
      id: 'email',
      label: 'Envoyer un Mail',
      content: <EmailSender csrfToken={csrfToken} />,
    },
    {
      id: 'instant',
      label: 'Messagerie Instantanée',
      content: <InstantMessaging csrfToken={csrfToken} />,
    },
    {
      id: 'announcement',
      label: 'Planifier une Annonce',
      content: <AnnouncementScheduler csrfToken={csrfToken} />,
    },
  ];

  return (
    <div className="flex h-full w-full">
      <SidebarTabs
        tabs={tabs}
        onTabChange={(tabId) => logger.debug(`Onglet actif : ${tabId}`)}
      />
    </div>
  );
}
