File size: 2,744 Bytes
ea270a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import {
  BatchPdfPanel,
  DocumentEnginePanel,
  SigningDashboard,
} from '@szl-holdings/shared-ui/document-engine';
import { cn } from '@szl-holdings/shared-ui/utils';
import { motion } from 'framer-motion';
import { BookOpen, FileText, Layers, Pen } from 'lucide-react';
import { useState } from 'react';

const TABS = [
  { id: 'documents', label: 'Documents', icon: FileText },
  { id: 'signing', label: 'Signing', icon: Pen },
  { id: 'pdf-batch', label: 'PDF Batches', icon: Layers },
] as const;

type TabId = (typeof TABS)[number]['id'];

export default function VesselsDocumentEngine() {
  const [activeTab, setActiveTab] = useState<TabId>('documents');

  return (
    <div className="flex flex-col h-full overflow-hidden">
      <motion.div
        initial={{ opacity: 0, y: -8 }}
        animate={{ opacity: 1, y: 0 }}
        className="flex-shrink-0"
      >
        <div className="flex items-center gap-3 px-6 pt-6 pb-0">
          <div className="w-8 h-8 rounded-xl bg-cyan-500/20 flex items-center justify-center">
            <BookOpen className="w-4 h-4 text-cyan-400" />
          </div>
          <div>
            <h1 className="text-xl font-display font-bold text-white">Document Engine</h1>
            <p className="text-xs text-white/40">
              Voyage reports, charter parties, and maritime documentation
            </p>
          </div>
        </div>
        <div className="flex items-center gap-1 px-6 pt-4 border-b border-white/10">
          {TABS.map((tab) => {
            const Icon = tab.icon;
            const isActive = activeTab === tab.id;
            return (
              <button
                key={tab.id}
                onClick={() => setActiveTab(tab.id)}
                className={cn(
                  'flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded-t-lg border-b-2 transition-colors',
                  isActive
                    ? 'border-cyan-400 text-cyan-400 bg-cyan-500/5'
                    : 'border-transparent text-white/50 hover:text-white',
                )}
              >
                <Icon className="w-3.5 h-3.5" />
                {tab.label}
              </button>
            );
          })}
        </div>
      </motion.div>

      <div className="flex-1 overflow-hidden">
        {activeTab === 'documents' && (
          <DocumentEnginePanel appSource="vessels" accentColor="#06b6d4" className="h-full" />
        )}
        {activeTab === 'signing' && (
          <SigningDashboard appSource="vessels" accentColor="#06b6d4" className="h-full" />
        )}
        {activeTab === 'pdf-batch' && (
          <BatchPdfPanel appSource="vessels" accentColor="#06b6d4" className="h-full" />
        )}
      </div>
    </div>
  );
}