/**
 * Standard Template
 * 
 * Purpose: Default request detail template for standard workflow requests
 * Used by: Regular users, standard approval workflows
 */

import {
  ClipboardList,
  TrendingUp,
  FileText,
  Activity,
  MessageSquare,
  FileCheck,
} from 'lucide-react';
import { RequestDetailTemplate } from '../types/template.types';
import { OverviewTab } from '../components/tabs/OverviewTab';
import { WorkflowTab } from '../components/tabs/WorkflowTab';
import { DocumentsTab } from '../components/tabs/DocumentsTab';
import { ActivityTab } from '../components/tabs/ActivityTab';
import { WorkNotesTab } from '../components/tabs/WorkNotesTab';
import { SummaryTab } from '../components/tabs/SummaryTab';

/**
 * Standard Template Configuration
 */
export const standardTemplate: RequestDetailTemplate = {
  id: 'standard',
  name: 'Standard Request',
  description: 'Default template for standard workflow requests',

  // Tab configuration
  tabs: [
    {
      id: 'overview',
      label: 'Overview',
      icon: ClipboardList,
      component: OverviewTab,
      order: 1,
    },
    {
      id: 'summary',
      label: 'Summary',
      icon: FileCheck,
      component: SummaryTab,
      visible: (context) => context.isClosed && !!context.summaryDetails,
      order: 2,
    },
    {
      id: 'workflow',
      label: 'Workflow',
      icon: TrendingUp,
      component: WorkflowTab,
      order: 3,
    },
    {
      id: 'documents',
      label: 'Docs',
      icon: FileText,
      component: DocumentsTab,
      order: 4,
    },
    {
      id: 'activity',
      label: 'Activity',
      icon: Activity,
      component: ActivityTab,
      order: 5,
    },
    {
      id: 'worknotes',
      label: 'Work Notes',
      icon: MessageSquare,
      component: WorkNotesTab,
      badge: (context) => context.unreadWorkNotes || null,
      order: 6,
    },
  ],

  defaultTab: 'overview',

  // Header configuration
  header: {
    showBackButton: true,
    showRefreshButton: true,
    showShareSummaryButton: true,
  },

  // Quick actions configuration
  quickActions: {
    enabled: true,
  },

  // Layout configuration
  layout: {
    showQuickActionsSidebar: true,
    fullWidthTabs: ['worknotes'],
  },

  // Access control
  canAccess: (user, request) => {
    // Standard access control logic
    return true;
  },
};

