braid-ui 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4339,7 +4339,7 @@ var UBOCard = ({ ubos, onUBOClick }) => {
4339
4339
  ) })
4340
4340
  ] });
4341
4341
  };
4342
- var BusinessDocuments = ({ businessId, documents }) => {
4342
+ var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
4343
4343
  const [isUploading, setIsUploading] = React15.useState(false);
4344
4344
  const [showUploadDialog, setShowUploadDialog] = React15.useState(false);
4345
4345
  const [selectedFile, setSelectedFile] = React15.useState(null);
@@ -4352,7 +4352,7 @@ var BusinessDocuments = ({ businessId, documents }) => {
4352
4352
  setSelectedFile(file);
4353
4353
  setDocumentName(file.name);
4354
4354
  };
4355
- const handleUploadSubmit = () => {
4355
+ const handleUploadSubmit = async () => {
4356
4356
  if (!selectedFile || !documentName || !documentType) {
4357
4357
  toast({
4358
4358
  title: "Missing Information",
@@ -4362,15 +4362,27 @@ var BusinessDocuments = ({ businessId, documents }) => {
4362
4362
  return;
4363
4363
  }
4364
4364
  setIsUploading(true);
4365
- setTimeout(() => {
4365
+ try {
4366
+ await onDocumentUpload(selectedFile, {
4367
+ name: documentName,
4368
+ description,
4369
+ type: documentType
4370
+ });
4366
4371
  toast({
4367
4372
  title: "Upload Successful",
4368
4373
  description: `${documentName} uploaded successfully`
4369
4374
  });
4370
- setIsUploading(false);
4371
4375
  setShowUploadDialog(false);
4372
4376
  resetForm();
4373
- }, 1e3);
4377
+ } catch (error) {
4378
+ toast({
4379
+ title: "Upload Failed",
4380
+ description: "Failed to upload document. Please try again.",
4381
+ variant: "destructive"
4382
+ });
4383
+ } finally {
4384
+ setIsUploading(false);
4385
+ }
4374
4386
  };
4375
4387
  const resetForm = () => {
4376
4388
  setSelectedFile(null);
@@ -4661,7 +4673,8 @@ var BusinessDetailView = ({
4661
4673
  onNavigateToAccounts,
4662
4674
  onNavigateToCounterparty,
4663
4675
  onAddAccount,
4664
- onUBOClick
4676
+ onUBOClick,
4677
+ onDocumentUpload
4665
4678
  }) => {
4666
4679
  return /* @__PURE__ */ jsxRuntime.jsx(
4667
4680
  PageLayout,
@@ -4734,7 +4747,14 @@ var BusinessDetailView = ({
4734
4747
  }
4735
4748
  ) })
4736
4749
  ] }),
4737
- /* @__PURE__ */ jsxRuntime.jsx(BusinessDocuments, { businessId: business.id, documents: businessDocuments })
4750
+ /* @__PURE__ */ jsxRuntime.jsx(
4751
+ BusinessDocuments,
4752
+ {
4753
+ businessId: business.id,
4754
+ documents: businessDocuments,
4755
+ onDocumentUpload
4756
+ }
4757
+ )
4738
4758
  ] }),
4739
4759
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
4740
4760
  } }) })
@@ -10396,7 +10416,7 @@ var BusinessDetail = () => {
10396
10416
  const business = mockBusinessesList.find((b) => b.id === id);
10397
10417
  const identityVerification = id ? mockIdentityVerifications[id] : void 0;
10398
10418
  const businessUBOs = id ? mockBusinessUBOs[id] || [] : [];
10399
- const businessDocuments = id ? mockBusinessDocuments[id] || [] : [];
10419
+ const initialDocuments = id ? mockBusinessDocuments[id] || [] : [];
10400
10420
  const businessAccounts = id ? mockBusinessAccounts[id] || [] : [];
10401
10421
  const initialProfile = id ? mockBusinessProfiles[id] : void 0;
10402
10422
  const [currentStatus, setCurrentStatus] = React15.useState(business?.status || "active");
@@ -10404,6 +10424,7 @@ var BusinessDetail = () => {
10404
10424
  const [businessProfile, setBusinessProfile] = React15.useState(
10405
10425
  initialProfile
10406
10426
  );
10427
+ const [businessDocuments, setBusinessDocuments] = React15.useState(initialDocuments);
10407
10428
  const handleStatusChange = (newStatus) => {
10408
10429
  setCurrentStatus(newStatus);
10409
10430
  };
@@ -10426,6 +10447,20 @@ var BusinessDetail = () => {
10426
10447
  const handleUBOClick = (customerId) => {
10427
10448
  navigate(`/customer/${customerId}`);
10428
10449
  };
10450
+ const handleDocumentUpload = async (file, metadata) => {
10451
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
10452
+ const newDocument = {
10453
+ id: `doc-${Date.now()}`,
10454
+ name: metadata.name,
10455
+ type: metadata.type,
10456
+ description: metadata.description,
10457
+ size: `${(file.size / 1024 / 1024).toFixed(2)} MB`,
10458
+ uploadedBy: "Current User",
10459
+ uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
10460
+ };
10461
+ setBusinessDocuments((prev) => [...prev, newDocument]);
10462
+ console.log("Document uploaded:", { file, metadata, newDocument });
10463
+ };
10429
10464
  if (!business) {
10430
10465
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
10431
10466
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold mb-2", children: "Business Not Found" }),
@@ -10449,7 +10484,8 @@ var BusinessDetail = () => {
10449
10484
  onNavigateToAccounts: handleNavigateToAccounts,
10450
10485
  onNavigateToCounterparty: handleNavigateToCounterparty,
10451
10486
  onAddAccount: handleAddAccount,
10452
- onUBOClick: handleUBOClick
10487
+ onUBOClick: handleUBOClick,
10488
+ onDocumentUpload: handleDocumentUpload
10453
10489
  }
10454
10490
  );
10455
10491
  };
@@ -10627,11 +10663,121 @@ var mockCounterpartiesList = [
10627
10663
  modified: "2023-12-28"
10628
10664
  }
10629
10665
  ];
10666
+ var CounterpartiesView = ({
10667
+ table,
10668
+ filters,
10669
+ onFilterChange,
10670
+ onResetFilters,
10671
+ onApplyFilters,
10672
+ onCreateCounterparty
10673
+ }) => {
10674
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
10675
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
10676
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
10677
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
10678
+ /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
10679
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
10680
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
10681
+ "Filters"
10682
+ ] }) }),
10683
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
10684
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Counterparty Filters" }) }),
10685
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
10686
+ /* @__PURE__ */ jsxRuntime.jsx(
10687
+ EnhancedInput,
10688
+ {
10689
+ label: "Name",
10690
+ value: filters.name,
10691
+ onChange: (e) => onFilterChange("name", e.target.value),
10692
+ placeholder: "Enter counterparty name"
10693
+ }
10694
+ ),
10695
+ /* @__PURE__ */ jsxRuntime.jsx(
10696
+ EnhancedSelect,
10697
+ {
10698
+ label: "Type",
10699
+ value: filters.type,
10700
+ onValueChange: (value) => onFilterChange("type", value),
10701
+ placeholder: "Select type",
10702
+ options: [
10703
+ { value: "BUSINESS", label: "Business" },
10704
+ { value: "INDIVIDUAL", label: "Individual" }
10705
+ ]
10706
+ }
10707
+ ),
10708
+ /* @__PURE__ */ jsxRuntime.jsx(
10709
+ EnhancedSelect,
10710
+ {
10711
+ label: "Status",
10712
+ value: filters.status,
10713
+ onValueChange: (value) => onFilterChange("status", value),
10714
+ placeholder: "Select status",
10715
+ options: [
10716
+ { value: "ACTIVE", label: "Active" },
10717
+ { value: "INACTIVE", label: "Inactive" },
10718
+ { value: "PENDING", label: "Pending" },
10719
+ { value: "SUSPENDED", label: "Suspended" }
10720
+ ]
10721
+ }
10722
+ ),
10723
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10724
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
10725
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
10726
+ /* @__PURE__ */ jsxRuntime.jsx(
10727
+ DatePicker,
10728
+ {
10729
+ date: filters.createdDateStart,
10730
+ onDateChange: (date) => onFilterChange("createdDateStart", date),
10731
+ placeholder: "MM/DD/YYYY",
10732
+ buttonClassName: "w-full",
10733
+ className: "bg-background z-50"
10734
+ }
10735
+ )
10736
+ ] }),
10737
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
10738
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
10739
+ /* @__PURE__ */ jsxRuntime.jsx(
10740
+ DatePicker,
10741
+ {
10742
+ date: filters.createdDateEnd,
10743
+ onDateChange: (date) => onFilterChange("createdDateEnd", date),
10744
+ placeholder: "MM/DD/YYYY",
10745
+ buttonClassName: "w-full",
10746
+ className: "bg-background z-50"
10747
+ }
10748
+ )
10749
+ ] })
10750
+ ] })
10751
+ ] }),
10752
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
10753
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: onResetFilters, children: "Reset Filters" }),
10754
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onApplyFilters, children: "Apply Filters" })
10755
+ ] })
10756
+ ] })
10757
+ ] }),
10758
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onCreateCounterparty, children: "Create Counterparty" })
10759
+ ] })
10760
+ ] }) }) }),
10761
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: table }) }) })
10762
+ ] });
10763
+ };
10764
+ var mockProducts3 = {
10765
+ "prod-001": "Business Banking Pro",
10766
+ "prod-002": "Premium Banking",
10767
+ "prod-003": "Business Banking Plus"
10768
+ };
10769
+ var mockBusinesses2 = {
10770
+ "bus-001": "Tech Solutions LLC",
10771
+ "bus-002": "Digital Ventures"
10772
+ };
10773
+ var mockIndividuals2 = {
10774
+ "ind-001": "Cloud Services Corp",
10775
+ "ind-002": "Wealth Management"
10776
+ };
10630
10777
  var Counterparties = () => {
10631
10778
  const navigate = reactRouterDom.useNavigate();
10632
10779
  const [searchParams] = reactRouterDom.useSearchParams();
10633
- const { counterparties: enrichedCounterparties, loading: loadingEntities } = useCounterpartyEntity(mockCounterpartiesList);
10634
- const [filteredCounterparties, setFilteredCounterparties] = React15.useState([]);
10780
+ const [counterparties, setCounterparties] = React15.useState([]);
10635
10781
  const [sortBy, setSortBy] = React15.useState("created");
10636
10782
  const [sortDirection, setSortDirection] = React15.useState("desc");
10637
10783
  const [filters, setFilters] = React15.useState({
@@ -10641,43 +10787,78 @@ var Counterparties = () => {
10641
10787
  createdDateStart: void 0,
10642
10788
  createdDateEnd: void 0
10643
10789
  });
10644
- const handleFilterChange = (field, value) => {
10645
- setFilters((prev) => ({ ...prev, [field]: value }));
10646
- };
10647
- const applyFilters = () => {
10648
- let filtered = enrichedCounterparties;
10790
+ React15.useEffect(() => {
10791
+ const enrichCounterparties = async () => {
10792
+ const enriched = await Promise.all(
10793
+ mockCounterpartiesList.map(async (counterparty) => {
10794
+ let associatedEntity = "";
10795
+ let entityType = null;
10796
+ if (counterparty.productId) {
10797
+ associatedEntity = mockProducts3[counterparty.productId] || counterparty.productId;
10798
+ entityType = "product";
10799
+ } else if (counterparty.businessId) {
10800
+ associatedEntity = mockBusinesses2[counterparty.businessId] || counterparty.businessId;
10801
+ entityType = "business";
10802
+ } else if (counterparty.individualId) {
10803
+ associatedEntity = mockIndividuals2[counterparty.individualId] || counterparty.individualId;
10804
+ entityType = "individual";
10805
+ } else if (counterparty.accountNumber) {
10806
+ associatedEntity = counterparty.accountNumber;
10807
+ entityType = "account";
10808
+ }
10809
+ return {
10810
+ ...counterparty,
10811
+ associatedEntity,
10812
+ entityType
10813
+ };
10814
+ })
10815
+ );
10816
+ setCounterparties(enriched);
10817
+ };
10818
+ enrichCounterparties();
10819
+ }, []);
10820
+ const filteredCounterparties = React15.useMemo(() => {
10821
+ const customerId = searchParams.get("customerId");
10822
+ let filtered = counterparties;
10823
+ if (customerId) {
10824
+ filtered = filtered.filter((cp) => cp.customerId === customerId);
10825
+ }
10649
10826
  if (filters.name) {
10650
10827
  filtered = filtered.filter(
10651
- (counterparty) => counterparty.name.toLowerCase().includes(filters.name.toLowerCase())
10828
+ (cp) => cp.name.toLowerCase().includes(filters.name.toLowerCase())
10652
10829
  );
10653
10830
  }
10654
10831
  if (filters.type) {
10655
- filtered = filtered.filter((counterparty) => counterparty.type === filters.type);
10832
+ filtered = filtered.filter((cp) => cp.type === filters.type);
10656
10833
  }
10657
10834
  if (filters.status) {
10658
- filtered = filtered.filter((counterparty) => counterparty.status === filters.status);
10835
+ filtered = filtered.filter((cp) => cp.status === filters.status);
10659
10836
  }
10660
10837
  if (filters.createdDateStart) {
10661
10838
  filtered = filtered.filter(
10662
- (counterparty) => new Date(counterparty.created) >= filters.createdDateStart
10839
+ (cp) => new Date(cp.created) >= filters.createdDateStart
10663
10840
  );
10664
10841
  }
10665
10842
  if (filters.createdDateEnd) {
10666
10843
  filtered = filtered.filter(
10667
- (counterparty) => new Date(counterparty.created) <= filters.createdDateEnd
10844
+ (cp) => new Date(cp.created) <= filters.createdDateEnd
10668
10845
  );
10669
10846
  }
10670
- setFilteredCounterparties(filtered);
10671
- };
10672
- React15.useEffect(() => {
10673
- const customerId = searchParams.get("customerId");
10674
- let filtered = enrichedCounterparties;
10675
- if (customerId) {
10676
- filtered = filtered.filter((cp) => cp.customerId === customerId);
10677
- }
10678
- setFilteredCounterparties(filtered);
10679
- }, [enrichedCounterparties, searchParams]);
10680
- const resetFilters = () => {
10847
+ return filtered;
10848
+ }, [counterparties, filters, searchParams]);
10849
+ const sortedCounterparties = React15.useMemo(() => {
10850
+ return [...filteredCounterparties].sort((a, b) => {
10851
+ const aValue = a[sortBy];
10852
+ const bValue = b[sortBy];
10853
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
10854
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
10855
+ return 0;
10856
+ });
10857
+ }, [filteredCounterparties, sortBy, sortDirection]);
10858
+ const handleFilterChange = React15.useCallback((field, value) => {
10859
+ setFilters((prev) => ({ ...prev, [field]: value }));
10860
+ }, []);
10861
+ const handleResetFilters = React15.useCallback(() => {
10681
10862
  setFilters({
10682
10863
  name: "",
10683
10864
  type: "",
@@ -10685,19 +10866,23 @@ var Counterparties = () => {
10685
10866
  createdDateStart: void 0,
10686
10867
  createdDateEnd: void 0
10687
10868
  });
10688
- setFilteredCounterparties(enrichedCounterparties);
10689
- };
10690
- const handleSort = (key) => {
10869
+ }, []);
10870
+ const handleApplyFilters = React15.useCallback(() => {
10871
+ }, []);
10872
+ const handleSort = React15.useCallback((key) => {
10691
10873
  if (sortBy === key) {
10692
- setSortDirection(sortDirection === "asc" ? "desc" : "asc");
10874
+ setSortDirection((prev) => prev === "asc" ? "desc" : "asc");
10693
10875
  } else {
10694
10876
  setSortBy(key);
10695
10877
  setSortDirection("asc");
10696
10878
  }
10697
- };
10698
- const handleRowClick = (counterparty) => {
10879
+ }, [sortBy]);
10880
+ const handleRowClick = React15.useCallback((counterparty) => {
10699
10881
  navigate(`/counterparty/${counterparty.id}`);
10700
- };
10882
+ }, [navigate]);
10883
+ const handleCreateCounterparty = React15.useCallback(() => {
10884
+ navigate("/counterparty/create");
10885
+ }, [navigate]);
10701
10886
  const columns3 = [
10702
10887
  {
10703
10888
  key: "name",
@@ -10750,112 +10935,28 @@ var Counterparties = () => {
10750
10935
  sortable: true
10751
10936
  }
10752
10937
  ];
10753
- const sortedCounterparties = [...filteredCounterparties].sort((a, b) => {
10754
- const aValue = a[sortBy];
10755
- const bValue = b[sortBy];
10756
- if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
10757
- if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
10758
- return 0;
10759
- });
10760
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
10761
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
10762
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground mb-2", children: "Counterparties" }) }),
10763
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
10764
- /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
10765
- /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
10766
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
10767
- "Filters"
10768
- ] }) }),
10769
- /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
10770
- /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Counterparty Filters" }) }),
10771
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
10772
- /* @__PURE__ */ jsxRuntime.jsx(
10773
- EnhancedInput,
10774
- {
10775
- label: "Name",
10776
- value: filters.name,
10777
- onChange: (e) => handleFilterChange("name", e.target.value),
10778
- placeholder: "Enter counterparty name"
10779
- }
10780
- ),
10781
- /* @__PURE__ */ jsxRuntime.jsx(
10782
- EnhancedSelect,
10783
- {
10784
- label: "Type",
10785
- value: filters.type,
10786
- onValueChange: (value) => handleFilterChange("type", value),
10787
- placeholder: "Select type",
10788
- options: [
10789
- { value: "BUSINESS", label: "Business" },
10790
- { value: "INDIVIDUAL", label: "Individual" }
10791
- ]
10792
- }
10793
- ),
10794
- /* @__PURE__ */ jsxRuntime.jsx(
10795
- EnhancedSelect,
10796
- {
10797
- label: "Status",
10798
- value: filters.status,
10799
- onValueChange: (value) => handleFilterChange("status", value),
10800
- placeholder: "Select status",
10801
- options: [
10802
- { value: "ACTIVE", label: "Active" },
10803
- { value: "INACTIVE", label: "Inactive" },
10804
- { value: "PENDING", label: "Pending" },
10805
- { value: "SUSPENDED", label: "Suspended" }
10806
- ]
10807
- }
10808
- ),
10809
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
10810
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
10811
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
10812
- /* @__PURE__ */ jsxRuntime.jsx(
10813
- DatePicker,
10814
- {
10815
- date: filters.createdDateStart,
10816
- onDateChange: (date) => handleFilterChange("createdDateStart", date),
10817
- placeholder: "MM/DD/YYYY",
10818
- buttonClassName: "w-full",
10819
- className: "bg-background z-50"
10820
- }
10821
- )
10822
- ] }),
10823
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
10824
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
10825
- /* @__PURE__ */ jsxRuntime.jsx(
10826
- DatePicker,
10827
- {
10828
- date: filters.createdDateEnd,
10829
- onDateChange: (date) => handleFilterChange("createdDateEnd", date),
10830
- placeholder: "MM/DD/YYYY",
10831
- buttonClassName: "w-full",
10832
- className: "bg-background z-50"
10833
- }
10834
- )
10835
- ] })
10836
- ] })
10837
- ] }),
10838
- /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
10839
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
10840
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
10841
- ] })
10842
- ] })
10843
- ] }),
10844
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => navigate("/counterparty/create"), children: "Create Counterparty" })
10845
- ] })
10846
- ] }) }) }),
10847
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
10848
- DataTable,
10849
- {
10850
- columns: columns3,
10851
- data: sortedCounterparties,
10852
- sortBy,
10853
- sortDirection,
10854
- onSort: handleSort,
10855
- onRowClick: handleRowClick
10856
- }
10857
- ) }) }) })
10858
- ] });
10938
+ const table = React15.useMemo(() => /* @__PURE__ */ jsxRuntime.jsx(
10939
+ DataTable,
10940
+ {
10941
+ columns: columns3,
10942
+ data: sortedCounterparties,
10943
+ sortBy,
10944
+ sortDirection,
10945
+ onSort: handleSort,
10946
+ onRowClick: handleRowClick
10947
+ }
10948
+ ), [columns3, sortedCounterparties, sortBy, sortDirection, handleSort, handleRowClick]);
10949
+ return /* @__PURE__ */ jsxRuntime.jsx(
10950
+ CounterpartiesView,
10951
+ {
10952
+ table,
10953
+ filters,
10954
+ onFilterChange: handleFilterChange,
10955
+ onResetFilters: handleResetFilters,
10956
+ onApplyFilters: handleApplyFilters,
10957
+ onCreateCounterparty: handleCreateCounterparty
10958
+ }
10959
+ );
10859
10960
  };
10860
10961
  var Counterparties_default = Counterparties;
10861
10962
  var mockCounterpartyTimeline = [