File size: 1,655 Bytes
766d85d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { usePackingList } from './usePackingListPanel'
import type { PackingListPanelProps } from './usePackingListPanel'
import { PackingHeader } from './PackingListPanelHeader'
import { PackingFilterTabs } from './PackingListPanelFilterTabs'
import { PackingList } from './PackingListPanelList'
import { BagSidebar } from './PackingListPanelBagSidebar'
import { BagModal } from './PackingListPanelBagModal'
import { BulkImportModal } from './PackingListPanelImportModal'

// Re-exported for tests and external callers that import it from this module.
export { itemWeight } from './packingListPanel.helpers'

export default function PackingListPanel(props: PackingListPanelProps) {
  const S = usePackingList(props)
  const { font, bagTrackingEnabled, bags, showBagModal, showImportModal } = S
  return (
    <div style={{ display: 'flex', flexDirection: 'column', height: '100%', ...font }}>
      {/* ── Header ── */}
      <PackingHeader {...S} />

      {/* ── Filter-Tabs ── */}
      <PackingFilterTabs {...S} />

      {/* ── Liste + Bags Sidebar ── */}
      <div style={{ flex: 1, display: 'flex', overflow: 'hidden' }}>
        <PackingList {...S} />
        {bagTrackingEnabled && bags.length > 0 && <BagSidebar {...S} />}
      </div>

      {/* ── Bag Modal (mobile + click) ── */}
      {showBagModal && bagTrackingEnabled && <BagModal {...S} />}

      <style>{`
        .assignee-chip:hover + .assignee-tooltip { opacity: 1 !important; }
        .assignee-chip:hover { opacity: 0.7; }
      `}</style>

      {/* Bulk Import Modal */}
      {showImportModal && <BulkImportModal {...S} />}
    </div>
  )
}