braid-ui 1.0.39 → 1.0.41

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.js CHANGED
@@ -5751,6 +5751,506 @@ var CounterpartiesView = ({
5751
5751
  ] });
5752
5752
  };
5753
5753
 
5754
+ // src/lib/mock-data/counterparty-data.ts
5755
+ var defaultCounterpartyDetail = {
5756
+ email: "contact@acme.com",
5757
+ phone: "+1 (555) 123-4567",
5758
+ dateOfBirth: "1985-03-15",
5759
+ idNumber: "ID-123456789",
5760
+ idType: "product_id",
5761
+ idValue: "PROD-001",
5762
+ address: {
5763
+ line1: "123 Business Ave",
5764
+ line2: "Suite 100",
5765
+ city: "New York",
5766
+ state: "NY",
5767
+ postalCode: "10001",
5768
+ countryCode: "US",
5769
+ type: "MAILING"
5770
+ }
5771
+ };
5772
+ var CounterpartyProfileCard = ({
5773
+ data,
5774
+ onDataChange,
5775
+ isEditing = false,
5776
+ onToggleEdit,
5777
+ hideActions = false,
5778
+ className,
5779
+ onEntityClick
5780
+ }) => {
5781
+ const form = useFormWithEditState({
5782
+ schema: counterpartyDetailSchema,
5783
+ defaultValues: { ...defaultCounterpartyDetail, ...data },
5784
+ initialEditing: isEditing,
5785
+ onToggleEdit,
5786
+ onSave: onDataChange
5787
+ });
5788
+ const editContent = /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5789
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5790
+ /* @__PURE__ */ jsx(
5791
+ FormSelect,
5792
+ {
5793
+ name: "idType",
5794
+ label: "Associated with",
5795
+ placeholder: "Select association type",
5796
+ options: [
5797
+ { value: "product_id", label: "Product ID" },
5798
+ { value: "business_id", label: "Business ID" },
5799
+ { value: "individual_id", label: "Individual ID" },
5800
+ { value: "account_number", label: "Account Number" }
5801
+ ]
5802
+ }
5803
+ ),
5804
+ /* @__PURE__ */ jsx(
5805
+ FormInput,
5806
+ {
5807
+ name: "idValue",
5808
+ label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
5809
+ placeholder: "Enter ID value"
5810
+ }
5811
+ ),
5812
+ /* @__PURE__ */ jsx(
5813
+ FormInput,
5814
+ {
5815
+ name: "email",
5816
+ label: "Email",
5817
+ type: "email",
5818
+ placeholder: "Enter email address"
5819
+ }
5820
+ ),
5821
+ /* @__PURE__ */ jsx(
5822
+ FormInput,
5823
+ {
5824
+ name: "phone",
5825
+ label: "Phone Number",
5826
+ type: "tel",
5827
+ placeholder: "Enter phone number"
5828
+ }
5829
+ ),
5830
+ /* @__PURE__ */ jsx(
5831
+ FormInput,
5832
+ {
5833
+ name: "dateOfBirth",
5834
+ label: "Date of Birth",
5835
+ type: "date",
5836
+ placeholder: "Select date of birth"
5837
+ }
5838
+ ),
5839
+ /* @__PURE__ */ jsx(
5840
+ FormInput,
5841
+ {
5842
+ name: "idNumber",
5843
+ label: "ID Number",
5844
+ placeholder: "Enter ID number"
5845
+ }
5846
+ )
5847
+ ] }),
5848
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
5849
+ /* @__PURE__ */ jsx(
5850
+ FormInput,
5851
+ {
5852
+ name: "address.line1",
5853
+ label: "Street Address",
5854
+ placeholder: "Enter street address"
5855
+ }
5856
+ ),
5857
+ /* @__PURE__ */ jsx(
5858
+ FormInput,
5859
+ {
5860
+ name: "address.line2",
5861
+ label: "Apartment, suite, or floor",
5862
+ placeholder: "Enter apartment, suite, or floor"
5863
+ }
5864
+ )
5865
+ ] }),
5866
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
5867
+ /* @__PURE__ */ jsx(
5868
+ FormInput,
5869
+ {
5870
+ name: "address.city",
5871
+ label: "City",
5872
+ placeholder: "Enter city"
5873
+ }
5874
+ ),
5875
+ /* @__PURE__ */ jsx(
5876
+ FormInput,
5877
+ {
5878
+ name: "address.state",
5879
+ label: "State",
5880
+ placeholder: "Enter state"
5881
+ }
5882
+ ),
5883
+ /* @__PURE__ */ jsx(
5884
+ FormInput,
5885
+ {
5886
+ name: "address.postalCode",
5887
+ label: "Postal Code",
5888
+ placeholder: "Enter postal code"
5889
+ }
5890
+ ),
5891
+ /* @__PURE__ */ jsx(
5892
+ FormInput,
5893
+ {
5894
+ name: "address.countryCode",
5895
+ label: "Country Code",
5896
+ placeholder: "e.g., US"
5897
+ }
5898
+ )
5899
+ ] })
5900
+ ] }) });
5901
+ const formValues = form.watch();
5902
+ const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
5903
+ const viewContent = /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
5904
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5905
+ /* @__PURE__ */ jsx(InfoField, { label: "Associated with", value: formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number", layout: "horizontal" }),
5906
+ /* @__PURE__ */ jsx(
5907
+ InfoField,
5908
+ {
5909
+ label: idTypeLabel,
5910
+ value: formValues?.idValue && formValues?.idType && onEntityClick ? /* @__PURE__ */ jsx(
5911
+ "button",
5912
+ {
5913
+ onClick: (e) => {
5914
+ e.preventDefault();
5915
+ onEntityClick(formValues.idType, formValues.idValue);
5916
+ },
5917
+ className: "text-primary hover:underline font-medium text-left cursor-pointer",
5918
+ children: formValues?.idValue || "-"
5919
+ }
5920
+ ) : formValues?.idValue || "-",
5921
+ layout: "horizontal"
5922
+ }
5923
+ )
5924
+ ] }),
5925
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5926
+ /* @__PURE__ */ jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
5927
+ /* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
5928
+ ] }),
5929
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
5930
+ /* @__PURE__ */ jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
5931
+ /* @__PURE__ */ jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
5932
+ ] }),
5933
+ /* @__PURE__ */ jsx(
5934
+ InfoField,
5935
+ {
5936
+ label: "Address",
5937
+ value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
5938
+ layout: "horizontal"
5939
+ }
5940
+ )
5941
+ ] });
5942
+ return /* @__PURE__ */ jsx(
5943
+ EditableFormCard,
5944
+ {
5945
+ title: "Profile Information",
5946
+ variant: "subtle",
5947
+ className,
5948
+ isEditing: form.isEditing,
5949
+ onToggleEdit: form.handleToggleEdit,
5950
+ onSave: form.handleSave,
5951
+ onCancel: form.handleCancel,
5952
+ hideActions,
5953
+ editContent,
5954
+ viewContent
5955
+ }
5956
+ );
5957
+ };
5958
+ var mockCounterpartyTimeline = [
5959
+ {
5960
+ id: "1",
5961
+ action: "Counterparty Created",
5962
+ user: "admin",
5963
+ details: "Initial counterparty setup",
5964
+ status: "Active",
5965
+ timestamp: "2024-01-15 10:30:00"
5966
+ },
5967
+ {
5968
+ id: "2",
5969
+ action: "Profile Updated",
5970
+ user: "admin",
5971
+ details: "Updated counterparty information",
5972
+ timestamp: "2024-01-20 14:22:00"
5973
+ },
5974
+ {
5975
+ id: "3",
5976
+ action: "OFAC Check Completed",
5977
+ user: "System",
5978
+ details: "Automated compliance check",
5979
+ status: "Verified",
5980
+ timestamp: "2024-01-20 14:30:00"
5981
+ }
5982
+ ];
5983
+ var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
5984
+ const getIcon = (action) => {
5985
+ if (action.includes("Created")) return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
5986
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsx(UserPlus, { className: "h-4 w-4" });
5987
+ if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" });
5988
+ if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
5989
+ return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
5990
+ };
5991
+ const getStatusColor2 = (status) => {
5992
+ switch (status) {
5993
+ case "Active":
5994
+ case "Verified":
5995
+ return "text-success";
5996
+ case "Pending":
5997
+ return "text-warning";
5998
+ default:
5999
+ return "text-muted-foreground";
6000
+ }
6001
+ };
6002
+ return /* @__PURE__ */ jsx(
6003
+ FormCard,
6004
+ {
6005
+ title: "Timeline",
6006
+ className,
6007
+ children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6 pb-3", children: [
6008
+ index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
6009
+ /* @__PURE__ */ jsx("div", { className: cn(
6010
+ "absolute left-0 top-0 flex-none",
6011
+ getStatusColor2(event.status)
6012
+ ), children: /* @__PURE__ */ jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
6013
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
6014
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
6015
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
6016
+ "by ",
6017
+ event.user
6018
+ ] }),
6019
+ event.details && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
6020
+ event.status && /* @__PURE__ */ jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
6021
+ "Status: ",
6022
+ event.status
6023
+ ] }),
6024
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
6025
+ ] })
6026
+ ] }, event.id)) })
6027
+ }
6028
+ );
6029
+ };
6030
+ var typeConfig2 = {
6031
+ BUSINESS: {
6032
+ variant: "business",
6033
+ label: "Business",
6034
+ icon: Building2
6035
+ },
6036
+ INDIVIDUAL: {
6037
+ variant: "individual",
6038
+ label: "Individual",
6039
+ icon: User
6040
+ }
6041
+ };
6042
+ var CounterpartyTypeBadge = ({ type, className }) => {
6043
+ const config = typeConfig2[type];
6044
+ if (!config) {
6045
+ return /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className, children: [
6046
+ /* @__PURE__ */ jsx(Building2, { className: "w-3 h-3 mr-1" }),
6047
+ type || "Unknown"
6048
+ ] });
6049
+ }
6050
+ const Icon2 = config.icon;
6051
+ return /* @__PURE__ */ jsxs(Badge, { variant: config.variant, className, children: [
6052
+ /* @__PURE__ */ jsx(Icon2, { className: "w-3 h-3 mr-1" }),
6053
+ config.label
6054
+ ] });
6055
+ };
6056
+ var PaymentMethodCard = ({
6057
+ type,
6058
+ fiId,
6059
+ accountNumber,
6060
+ bankName,
6061
+ accountType,
6062
+ beneficiaryBankName,
6063
+ correspondentBankId,
6064
+ intermediaryBankId,
6065
+ className
6066
+ }) => {
6067
+ const getIcon = () => {
6068
+ switch (type) {
6069
+ case "ACH":
6070
+ return Building2;
6071
+ case "Domestic Wire":
6072
+ return Landmark;
6073
+ case "International Wire":
6074
+ return Globe;
6075
+ default:
6076
+ return Building2;
6077
+ }
6078
+ };
6079
+ const Icon2 = getIcon();
6080
+ return /* @__PURE__ */ jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
6081
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
6082
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6083
+ /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
6084
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: type })
6085
+ ] }),
6086
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" }) })
6087
+ ] }),
6088
+ /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3", children: [
6089
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6090
+ /* @__PURE__ */ jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
6091
+ /* @__PURE__ */ jsx(InfoField, { label: "Account Number", value: accountNumber })
6092
+ ] }),
6093
+ type === "ACH" && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6094
+ bankName && /* @__PURE__ */ jsx(InfoField, { label: "Bank Name", value: bankName }),
6095
+ accountType && /* @__PURE__ */ jsx(InfoField, { label: "Account Type", value: accountType })
6096
+ ] }),
6097
+ type === "Domestic Wire" && bankName && /* @__PURE__ */ jsx(InfoField, { label: "Bank Name", value: bankName }),
6098
+ type === "International Wire" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
6099
+ beneficiaryBankName && /* @__PURE__ */ jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
6100
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
6101
+ correspondentBankId && /* @__PURE__ */ jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
6102
+ intermediaryBankId && /* @__PURE__ */ jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
6103
+ ] })
6104
+ ] })
6105
+ ] })
6106
+ ] });
6107
+ };
6108
+ var typeClasses = {
6109
+ cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
6110
+ forms: "grid-cols-1 lg:grid-cols-2",
6111
+ data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
6112
+ custom: ""
6113
+ };
6114
+ var gapClasses = {
6115
+ sm: "gap-3",
6116
+ md: "gap-4",
6117
+ lg: "gap-6",
6118
+ xl: "gap-8"
6119
+ };
6120
+ var ResponsiveGrid = React15.forwardRef(
6121
+ ({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
6122
+ const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
6123
+ return /* @__PURE__ */ jsx(
6124
+ "div",
6125
+ {
6126
+ ref,
6127
+ className: cn(
6128
+ "grid",
6129
+ gridClasses2,
6130
+ gapClasses[gap],
6131
+ className
6132
+ ),
6133
+ children
6134
+ }
6135
+ );
6136
+ }
6137
+ );
6138
+ ResponsiveGrid.displayName = "ResponsiveGrid";
6139
+ var CounterpartyDetailView = ({
6140
+ counterpartyName,
6141
+ counterpartyType,
6142
+ currentStatus,
6143
+ isEditingProfile,
6144
+ mockPaymentMethods: mockPaymentMethods2,
6145
+ documents,
6146
+ onStatusChange,
6147
+ onToggleProfileEdit,
6148
+ onAddPaymentMethod,
6149
+ onAddDocument,
6150
+ onEntityClick
6151
+ }) => {
6152
+ const documentColumns = [
6153
+ {
6154
+ key: "name",
6155
+ title: "Document Name",
6156
+ sortable: true,
6157
+ width: "40%"
6158
+ },
6159
+ {
6160
+ key: "type",
6161
+ title: "Type",
6162
+ sortable: true,
6163
+ width: "20%"
6164
+ },
6165
+ {
6166
+ key: "uploadedDate",
6167
+ title: "Uploaded",
6168
+ sortable: true,
6169
+ width: "20%"
6170
+ },
6171
+ {
6172
+ key: "status",
6173
+ title: "Status",
6174
+ sortable: true,
6175
+ width: "20%",
6176
+ align: "right",
6177
+ render: (value) => /* @__PURE__ */ jsx("span", { className: "capitalize", children: value })
6178
+ }
6179
+ ];
6180
+ return /* @__PURE__ */ jsx(
6181
+ PageLayout,
6182
+ {
6183
+ title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
6184
+ /* @__PURE__ */ jsx("span", { children: counterpartyName }),
6185
+ /* @__PURE__ */ jsx(
6186
+ EditableInfoField,
6187
+ {
6188
+ label: "",
6189
+ value: currentStatus,
6190
+ options: [
6191
+ { value: "ACTIVE", label: "Active" },
6192
+ { value: "INACTIVE", label: "Inactive" },
6193
+ { value: "PENDING", label: "Pending" },
6194
+ { value: "SUSPENDED", label: "Suspended" }
6195
+ ],
6196
+ onChange: onStatusChange,
6197
+ renderValue: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value }),
6198
+ className: "inline-block"
6199
+ }
6200
+ ),
6201
+ /* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterpartyType })
6202
+ ] }),
6203
+ maxWidth: "full",
6204
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
6205
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
6206
+ /* @__PURE__ */ jsx(
6207
+ CounterpartyProfileCard,
6208
+ {
6209
+ isEditing: isEditingProfile,
6210
+ onToggleEdit: onToggleProfileEdit,
6211
+ onEntityClick
6212
+ }
6213
+ ),
6214
+ /* @__PURE__ */ jsxs(Card, { children: [
6215
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
6216
+ /* @__PURE__ */ jsx(CardTitle, { children: "Payment Methods" }),
6217
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
6218
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
6219
+ "Method"
6220
+ ] })
6221
+ ] }),
6222
+ /* @__PURE__ */ jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
6223
+ /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
6224
+ /* @__PURE__ */ jsx("p", { children: "No payment methods configured" })
6225
+ ] }) : /* @__PURE__ */ jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsx(PaymentMethodCard, { ...method }, index)) }) })
6226
+ ] }),
6227
+ /* @__PURE__ */ jsxs(Card, { children: [
6228
+ /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
6229
+ /* @__PURE__ */ jsx(CardTitle, { children: "Documents" }),
6230
+ /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
6231
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
6232
+ "Document"
6233
+ ] })
6234
+ ] }),
6235
+ /* @__PURE__ */ jsx(CardContent, { children: documents.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
6236
+ /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5 opacity-50" }),
6237
+ /* @__PURE__ */ jsx("p", { children: "No documents found" })
6238
+ ] }) : /* @__PURE__ */ jsx(
6239
+ DataTable,
6240
+ {
6241
+ columns: documentColumns,
6242
+ data: documents
6243
+ }
6244
+ ) })
6245
+ ] })
6246
+ ] }),
6247
+ /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
6248
+ } }) })
6249
+ ] })
6250
+ }
6251
+ );
6252
+ };
6253
+
5754
6254
  // src/lib/mock-data/banking-data.ts
5755
6255
  var defaultACHBankDetails = {
5756
6256
  gatewayRoutingNumber: "043087080",
@@ -5899,49 +6399,18 @@ var ACHBasicInfoCard = ({
5899
6399
  title: "Basic Information",
5900
6400
  variant: "subtle",
5901
6401
  className,
5902
- isEditing: form.isEditing,
5903
- onToggleEdit: form.handleToggleEdit,
5904
- onSave: form.handleSave,
5905
- onCancel: form.handleCancel,
5906
- hideActions,
5907
- isFormValid: form.isFormValid,
5908
- isDirty: form.isDirty,
5909
- editContent,
5910
- viewContent
5911
- }
5912
- );
5913
- };
5914
- var typeClasses = {
5915
- cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
5916
- forms: "grid-cols-1 lg:grid-cols-2",
5917
- data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
5918
- custom: ""
5919
- };
5920
- var gapClasses = {
5921
- sm: "gap-3",
5922
- md: "gap-4",
5923
- lg: "gap-6",
5924
- xl: "gap-8"
5925
- };
5926
- var ResponsiveGrid = React15.forwardRef(
5927
- ({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
5928
- const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
5929
- return /* @__PURE__ */ jsx(
5930
- "div",
5931
- {
5932
- ref,
5933
- className: cn(
5934
- "grid",
5935
- gridClasses2,
5936
- gapClasses[gap],
5937
- className
5938
- ),
5939
- children
5940
- }
5941
- );
5942
- }
5943
- );
5944
- ResponsiveGrid.displayName = "ResponsiveGrid";
6402
+ isEditing: form.isEditing,
6403
+ onToggleEdit: form.handleToggleEdit,
6404
+ onSave: form.handleSave,
6405
+ onCancel: form.handleCancel,
6406
+ hideActions,
6407
+ isFormValid: form.isFormValid,
6408
+ isDirty: form.isDirty,
6409
+ editContent,
6410
+ viewContent
6411
+ }
6412
+ );
6413
+ };
5945
6414
  var BankAddressCard = ({
5946
6415
  data,
5947
6416
  onDataChange,
@@ -6158,32 +6627,6 @@ var BankingDetailsCard = ({ isEditing, onToggleEdit, className }) => {
6158
6627
  }
6159
6628
  );
6160
6629
  };
6161
- var typeConfig2 = {
6162
- BUSINESS: {
6163
- variant: "business",
6164
- label: "Business",
6165
- icon: Building2
6166
- },
6167
- INDIVIDUAL: {
6168
- variant: "individual",
6169
- label: "Individual",
6170
- icon: User
6171
- }
6172
- };
6173
- var CounterpartyTypeBadge = ({ type, className }) => {
6174
- const config = typeConfig2[type];
6175
- if (!config) {
6176
- return /* @__PURE__ */ jsxs(Badge, { variant: "secondary", className, children: [
6177
- /* @__PURE__ */ jsx(Building2, { className: "w-3 h-3 mr-1" }),
6178
- type || "Unknown"
6179
- ] });
6180
- }
6181
- const Icon2 = config.icon;
6182
- return /* @__PURE__ */ jsxs(Badge, { variant: config.variant, className, children: [
6183
- /* @__PURE__ */ jsx(Icon2, { className: "w-3 h-3 mr-1" }),
6184
- config.label
6185
- ] });
6186
- };
6187
6630
  var BasicInfoCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
6188
6631
  const [name, setName] = useState("John wire hot");
6189
6632
  const [status, setStatus] = useState("ACTIVE");
@@ -6242,245 +6685,26 @@ var BasicInfoCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
6242
6685
  /* @__PURE__ */ jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
6243
6686
  /* @__PURE__ */ jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
6244
6687
  /* @__PURE__ */ jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
6245
- /* @__PURE__ */ jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
6246
- /* @__PURE__ */ jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
6247
- /* @__PURE__ */ jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
6248
- /* @__PURE__ */ jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
6249
- ] }),
6250
- /* @__PURE__ */ jsxs("div", { className: "pt-3 border-t border-border", children: [
6251
- /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
6252
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6253
- /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
6254
- /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
6255
- ] })
6256
- ] })
6257
- ] });
6258
- return /* @__PURE__ */ jsx(
6259
- EditableFormCard,
6260
- {
6261
- title: "Basic Info",
6262
- className,
6263
- isEditing,
6264
- onToggleEdit,
6265
- hideActions,
6266
- editContent,
6267
- viewContent
6268
- }
6269
- );
6270
- };
6271
-
6272
- // src/lib/mock-data/counterparty-data.ts
6273
- var defaultCounterpartyDetail = {
6274
- email: "contact@acme.com",
6275
- phone: "+1 (555) 123-4567",
6276
- dateOfBirth: "1985-03-15",
6277
- idNumber: "ID-123456789",
6278
- idType: "product_id",
6279
- idValue: "PROD-001",
6280
- address: {
6281
- line1: "123 Business Ave",
6282
- line2: "Suite 100",
6283
- city: "New York",
6284
- state: "NY",
6285
- postalCode: "10001",
6286
- countryCode: "US",
6287
- type: "MAILING"
6288
- }
6289
- };
6290
- var CounterpartyProfileCard = ({
6291
- data,
6292
- onDataChange,
6293
- isEditing = false,
6294
- onToggleEdit,
6295
- hideActions = false,
6296
- className
6297
- }) => {
6298
- const navigate = useNavigate();
6299
- const form = useFormWithEditState({
6300
- schema: counterpartyDetailSchema,
6301
- defaultValues: { ...defaultCounterpartyDetail, ...data },
6302
- initialEditing: isEditing,
6303
- onToggleEdit,
6304
- onSave: onDataChange
6305
- });
6306
- const editContent = /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6307
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
6308
- /* @__PURE__ */ jsx(
6309
- FormSelect,
6310
- {
6311
- name: "idType",
6312
- label: "Associated with",
6313
- placeholder: "Select association type",
6314
- options: [
6315
- { value: "product_id", label: "Product ID" },
6316
- { value: "business_id", label: "Business ID" },
6317
- { value: "individual_id", label: "Individual ID" },
6318
- { value: "account_number", label: "Account Number" }
6319
- ]
6320
- }
6321
- ),
6322
- /* @__PURE__ */ jsx(
6323
- FormInput,
6324
- {
6325
- name: "idValue",
6326
- label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
6327
- placeholder: "Enter ID value"
6328
- }
6329
- ),
6330
- /* @__PURE__ */ jsx(
6331
- FormInput,
6332
- {
6333
- name: "email",
6334
- label: "Email",
6335
- type: "email",
6336
- placeholder: "Enter email address"
6337
- }
6338
- ),
6339
- /* @__PURE__ */ jsx(
6340
- FormInput,
6341
- {
6342
- name: "phone",
6343
- label: "Phone Number",
6344
- type: "tel",
6345
- placeholder: "Enter phone number"
6346
- }
6347
- ),
6348
- /* @__PURE__ */ jsx(
6349
- FormInput,
6350
- {
6351
- name: "dateOfBirth",
6352
- label: "Date of Birth",
6353
- type: "date",
6354
- placeholder: "Select date of birth"
6355
- }
6356
- ),
6357
- /* @__PURE__ */ jsx(
6358
- FormInput,
6359
- {
6360
- name: "idNumber",
6361
- label: "ID Number",
6362
- placeholder: "Enter ID number"
6363
- }
6364
- )
6365
- ] }),
6366
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
6367
- /* @__PURE__ */ jsx(
6368
- FormInput,
6369
- {
6370
- name: "address.line1",
6371
- label: "Street Address",
6372
- placeholder: "Enter street address"
6373
- }
6374
- ),
6375
- /* @__PURE__ */ jsx(
6376
- FormInput,
6377
- {
6378
- name: "address.line2",
6379
- label: "Apartment, suite, or floor",
6380
- placeholder: "Enter apartment, suite, or floor"
6381
- }
6382
- )
6383
- ] }),
6384
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
6385
- /* @__PURE__ */ jsx(
6386
- FormInput,
6387
- {
6388
- name: "address.city",
6389
- label: "City",
6390
- placeholder: "Enter city"
6391
- }
6392
- ),
6393
- /* @__PURE__ */ jsx(
6394
- FormInput,
6395
- {
6396
- name: "address.state",
6397
- label: "State",
6398
- placeholder: "Enter state"
6399
- }
6400
- ),
6401
- /* @__PURE__ */ jsx(
6402
- FormInput,
6403
- {
6404
- name: "address.postalCode",
6405
- label: "Postal Code",
6406
- placeholder: "Enter postal code"
6407
- }
6408
- ),
6409
- /* @__PURE__ */ jsx(
6410
- FormInput,
6411
- {
6412
- name: "address.countryCode",
6413
- label: "Country Code",
6414
- placeholder: "e.g., US"
6415
- }
6416
- )
6417
- ] })
6418
- ] }) });
6419
- const formValues = form.watch();
6420
- const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
6421
- const getEntityLink = () => {
6422
- if (!formValues?.idValue) return null;
6423
- switch (formValues?.idType) {
6424
- case "business_id":
6425
- return `/business/${formValues.idValue}`;
6426
- case "individual_id":
6427
- return `/individual/${formValues.idValue}`;
6428
- case "account_number":
6429
- return `/account/${formValues.idValue}`;
6430
- default:
6431
- return null;
6432
- }
6433
- };
6434
- const entityLink = getEntityLink();
6435
- const viewContent = /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
6436
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6437
- /* @__PURE__ */ jsx(InfoField, { label: "Associated with", value: formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number", layout: "horizontal" }),
6438
- /* @__PURE__ */ jsx(
6439
- InfoField,
6440
- {
6441
- label: idTypeLabel,
6442
- value: entityLink ? /* @__PURE__ */ jsx(
6443
- "button",
6444
- {
6445
- onClick: (e) => {
6446
- e.preventDefault();
6447
- navigate(entityLink);
6448
- },
6449
- className: "text-primary hover:underline font-medium text-left cursor-pointer",
6450
- children: formValues?.idValue || "-"
6451
- }
6452
- ) : formValues?.idValue || "-",
6453
- layout: "horizontal"
6454
- }
6455
- )
6456
- ] }),
6457
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6458
- /* @__PURE__ */ jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
6459
- /* @__PURE__ */ jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
6460
- ] }),
6461
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6462
- /* @__PURE__ */ jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
6463
- /* @__PURE__ */ jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
6464
- ] }),
6465
- /* @__PURE__ */ jsx(
6466
- InfoField,
6467
- {
6468
- label: "Address",
6469
- value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
6470
- layout: "horizontal"
6471
- }
6472
- )
6688
+ /* @__PURE__ */ jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
6689
+ /* @__PURE__ */ jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
6690
+ /* @__PURE__ */ jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
6691
+ /* @__PURE__ */ jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
6692
+ ] }),
6693
+ /* @__PURE__ */ jsxs("div", { className: "pt-3 border-t border-border", children: [
6694
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
6695
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6696
+ /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
6697
+ /* @__PURE__ */ jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
6698
+ ] })
6699
+ ] })
6473
6700
  ] });
6474
6701
  return /* @__PURE__ */ jsx(
6475
6702
  EditableFormCard,
6476
6703
  {
6477
- title: "Profile Information",
6478
- variant: "subtle",
6704
+ title: "Basic Info",
6479
6705
  className,
6480
- isEditing: form.isEditing,
6481
- onToggleEdit: form.handleToggleEdit,
6482
- onSave: form.handleSave,
6483
- onCancel: form.handleCancel,
6706
+ isEditing,
6707
+ onToggleEdit,
6484
6708
  hideActions,
6485
6709
  editContent,
6486
6710
  viewContent
@@ -11285,205 +11509,6 @@ var Counterparties = () => {
11285
11509
  );
11286
11510
  };
11287
11511
  var Counterparties_default = Counterparties;
11288
- var mockCounterpartyTimeline = [
11289
- {
11290
- id: "1",
11291
- action: "Counterparty Created",
11292
- user: "admin",
11293
- details: "Initial counterparty setup",
11294
- status: "Active",
11295
- timestamp: "2024-01-15 10:30:00"
11296
- },
11297
- {
11298
- id: "2",
11299
- action: "Profile Updated",
11300
- user: "admin",
11301
- details: "Updated counterparty information",
11302
- timestamp: "2024-01-20 14:22:00"
11303
- },
11304
- {
11305
- id: "3",
11306
- action: "OFAC Check Completed",
11307
- user: "System",
11308
- details: "Automated compliance check",
11309
- status: "Verified",
11310
- timestamp: "2024-01-20 14:30:00"
11311
- }
11312
- ];
11313
- var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
11314
- const getIcon = (action) => {
11315
- if (action.includes("Created")) return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
11316
- if (action.includes("Assigned")) return /* @__PURE__ */ jsx(UserPlus, { className: "h-4 w-4" });
11317
- if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" });
11318
- if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" });
11319
- return /* @__PURE__ */ jsx(Circle, { className: "h-4 w-4" });
11320
- };
11321
- const getStatusColor2 = (status) => {
11322
- switch (status) {
11323
- case "Active":
11324
- case "Verified":
11325
- return "text-success";
11326
- case "Pending":
11327
- return "text-warning";
11328
- default:
11329
- return "text-muted-foreground";
11330
- }
11331
- };
11332
- return /* @__PURE__ */ jsx(
11333
- FormCard,
11334
- {
11335
- title: "Timeline",
11336
- className,
11337
- children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6 pb-3", children: [
11338
- index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
11339
- /* @__PURE__ */ jsx("div", { className: cn(
11340
- "absolute left-0 top-0 flex-none",
11341
- getStatusColor2(event.status)
11342
- ), children: /* @__PURE__ */ jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
11343
- /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
11344
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
11345
- /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
11346
- "by ",
11347
- event.user
11348
- ] }),
11349
- event.details && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
11350
- event.status && /* @__PURE__ */ jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
11351
- "Status: ",
11352
- event.status
11353
- ] }),
11354
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
11355
- ] })
11356
- ] }, event.id)) })
11357
- }
11358
- );
11359
- };
11360
- var PaymentMethodCard = ({
11361
- type,
11362
- fiId,
11363
- accountNumber,
11364
- bankName,
11365
- accountType,
11366
- beneficiaryBankName,
11367
- correspondentBankId,
11368
- intermediaryBankId,
11369
- className
11370
- }) => {
11371
- const getIcon = () => {
11372
- switch (type) {
11373
- case "ACH":
11374
- return Building2;
11375
- case "Domestic Wire":
11376
- return Landmark;
11377
- case "International Wire":
11378
- return Globe;
11379
- default:
11380
- return Building2;
11381
- }
11382
- };
11383
- const Icon2 = getIcon();
11384
- return /* @__PURE__ */ jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
11385
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
11386
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11387
- /* @__PURE__ */ jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
11388
- /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: type })
11389
- ] }),
11390
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" }) })
11391
- ] }),
11392
- /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3", children: [
11393
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11394
- /* @__PURE__ */ jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
11395
- /* @__PURE__ */ jsx(InfoField, { label: "Account Number", value: accountNumber })
11396
- ] }),
11397
- type === "ACH" && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11398
- bankName && /* @__PURE__ */ jsx(InfoField, { label: "Bank Name", value: bankName }),
11399
- accountType && /* @__PURE__ */ jsx(InfoField, { label: "Account Type", value: accountType })
11400
- ] }),
11401
- type === "Domestic Wire" && bankName && /* @__PURE__ */ jsx(InfoField, { label: "Bank Name", value: bankName }),
11402
- type === "International Wire" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
11403
- beneficiaryBankName && /* @__PURE__ */ jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
11404
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
11405
- correspondentBankId && /* @__PURE__ */ jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
11406
- intermediaryBankId && /* @__PURE__ */ jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
11407
- ] })
11408
- ] })
11409
- ] })
11410
- ] });
11411
- };
11412
- var CounterpartyDetailView = ({
11413
- counterpartyName,
11414
- counterpartyType,
11415
- currentStatus,
11416
- isEditingProfile,
11417
- mockPaymentMethods: mockPaymentMethods2,
11418
- documentsTable,
11419
- onStatusChange,
11420
- onToggleProfileEdit,
11421
- onAddPaymentMethod,
11422
- onAddDocument
11423
- }) => {
11424
- return /* @__PURE__ */ jsx(
11425
- PageLayout,
11426
- {
11427
- title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
11428
- /* @__PURE__ */ jsx("span", { children: counterpartyName }),
11429
- /* @__PURE__ */ jsx(
11430
- EditableInfoField,
11431
- {
11432
- label: "",
11433
- value: currentStatus,
11434
- options: [
11435
- { value: "ACTIVE", label: "Active" },
11436
- { value: "INACTIVE", label: "Inactive" },
11437
- { value: "PENDING", label: "Pending" },
11438
- { value: "SUSPENDED", label: "Suspended" }
11439
- ],
11440
- onChange: onStatusChange,
11441
- renderValue: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value }),
11442
- className: "inline-block"
11443
- }
11444
- ),
11445
- /* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterpartyType })
11446
- ] }),
11447
- maxWidth: "full",
11448
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
11449
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
11450
- /* @__PURE__ */ jsx(
11451
- CounterpartyProfileCard,
11452
- {
11453
- isEditing: isEditingProfile,
11454
- onToggleEdit: onToggleProfileEdit
11455
- }
11456
- ),
11457
- /* @__PURE__ */ jsxs(Card, { children: [
11458
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11459
- /* @__PURE__ */ jsx(CardTitle, { children: "Payment Methods" }),
11460
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
11461
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11462
- "Method"
11463
- ] })
11464
- ] }),
11465
- /* @__PURE__ */ jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11466
- /* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
11467
- /* @__PURE__ */ jsx("p", { children: "No payment methods configured" })
11468
- ] }) : /* @__PURE__ */ jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsx(PaymentMethodCard, { ...method }, index)) }) })
11469
- ] }),
11470
- /* @__PURE__ */ jsxs(Card, { children: [
11471
- /* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
11472
- /* @__PURE__ */ jsx(CardTitle, { children: "Documents" }),
11473
- /* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
11474
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
11475
- "Document"
11476
- ] })
11477
- ] }),
11478
- /* @__PURE__ */ jsx(CardContent, { children: documentsTable })
11479
- ] })
11480
- ] }),
11481
- /* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
11482
- } }) })
11483
- ] })
11484
- }
11485
- );
11486
- };
11487
11512
  var mockPaymentMethods = [
11488
11513
  {
11489
11514
  type: "ACH",
@@ -11509,39 +11534,24 @@ var mockPaymentMethods = [
11509
11534
  ];
11510
11535
  var CounterpartyDetail = () => {
11511
11536
  const { id } = useParams();
11512
- useNavigate();
11537
+ const navigate = useNavigate();
11513
11538
  const counterparty = mockCounterpartiesList.find((c) => c.id === id);
11514
11539
  const counterpartyDocuments = id ? mockBusinessDocuments[id] || [] : [];
11515
11540
  const [currentStatus, setCurrentStatus] = useState(counterparty?.status || "ACTIVE");
11516
11541
  const [isEditingProfile, setIsEditingProfile] = useState(false);
11517
- const documentColumns = [
11518
- {
11519
- key: "name",
11520
- title: "Document Name",
11521
- sortable: true,
11522
- width: "40%"
11523
- },
11524
- {
11525
- key: "type",
11526
- title: "Type",
11527
- sortable: true,
11528
- width: "20%"
11529
- },
11530
- {
11531
- key: "uploadedDate",
11532
- title: "Uploaded",
11533
- sortable: true,
11534
- width: "20%"
11535
- },
11536
- {
11537
- key: "status",
11538
- title: "Status",
11539
- sortable: true,
11540
- width: "20%",
11541
- align: "right",
11542
- render: (value) => /* @__PURE__ */ jsx("span", { className: "capitalize", children: value })
11542
+ const handleEntityClick = (entityType, entityId) => {
11543
+ switch (entityType) {
11544
+ case "business_id":
11545
+ navigate(`/business/${entityId}`);
11546
+ break;
11547
+ case "individual_id":
11548
+ navigate(`/individual/${entityId}`);
11549
+ break;
11550
+ case "account_number":
11551
+ navigate(`/account/${entityId}`);
11552
+ break;
11543
11553
  }
11544
- ];
11554
+ };
11545
11555
  const handleStatusChange = (newStatus) => {
11546
11556
  setCurrentStatus(newStatus);
11547
11557
  };
@@ -11554,21 +11564,6 @@ var CounterpartyDetail = () => {
11554
11564
  const handleAddDocument = () => {
11555
11565
  console.log("Add document");
11556
11566
  };
11557
- const documentsTable = useMemo(() => {
11558
- if (counterpartyDocuments.length === 0) {
11559
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
11560
- /* @__PURE__ */ jsx(FileText, { className: "h-5 w-5 opacity-50" }),
11561
- /* @__PURE__ */ jsx("p", { children: "No documents found" })
11562
- ] });
11563
- }
11564
- return /* @__PURE__ */ jsx(
11565
- DataTable,
11566
- {
11567
- columns: documentColumns,
11568
- data: counterpartyDocuments
11569
- }
11570
- );
11571
- }, [counterpartyDocuments, documentColumns]);
11572
11567
  if (!counterparty) {
11573
11568
  return /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
11574
11569
  /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mb-2", children: "Counterparty Not Found" }),
@@ -11583,11 +11578,12 @@ var CounterpartyDetail = () => {
11583
11578
  currentStatus,
11584
11579
  isEditingProfile,
11585
11580
  mockPaymentMethods,
11586
- documentsTable,
11581
+ documents: counterpartyDocuments,
11587
11582
  onStatusChange: handleStatusChange,
11588
11583
  onToggleProfileEdit: handleToggleProfileEdit,
11589
11584
  onAddPaymentMethod: handleAddPaymentMethod,
11590
- onAddDocument: handleAddDocument
11585
+ onAddDocument: handleAddDocument,
11586
+ onEntityClick: handleEntityClick
11591
11587
  }
11592
11588
  );
11593
11589
  };
@@ -14716,6 +14712,6 @@ function OFAC() {
14716
14712
  ] });
14717
14713
  }
14718
14714
 
14719
- export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFAC, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
14715
+ export { ACHBankCard, ACHBasicInfoCard, ACHDetailsSection, ACHTransferSection, AccountCard, AccountDetail_default as AccountDetail, Accounts_default as Accounts, AddressForm, AlertDetail_default as AlertDetail, AlertDetailRouter, AlertDocuments, AlertHeaderControls, AlertNotes, AlertTimeline, Alerts_default as Alerts, AppSidebar, Badge, BankAddressCard, BankingDetailsCard, BasicInfoCard, BasicInfoSection, BeneficiaryAddress, BeneficiaryCard, BeneficiaryDomesticWire, Breadcrumb, BusinessDetail_default as BusinessDetail, BusinessDetailView, BusinessFiltersSheet, BusinessProfileCard, BusinessStatusCard, BusinessTypeBadge, Businesses_default as Businesses, Button, CIPStatusBadge, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cases_default as Cases, Checkbox, ContactInfoCard, Container, ContextSection, Counterparties_default as Counterparties, CounterpartiesView, CounterpartyBasicInfo, CounterpartyDetail_default as CounterpartyDetail, CounterpartyDetailView, CounterpartyProfileCard, CounterpartyRecordsCard, CounterpartyTypeBadge, Create_default as CreateBusiness, CreateBusinessView, Create_default2 as CreateCounterparty, Create_default3 as CreateIndividual, Dashboard_default as Dashboard, DashboardDemo, DataGrid, DataTable, DetailPageLayout, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EditableFormCard, EditableInfoField, EnhancedInput, EnhancedSelect, EnhancedTextarea, EntityCard, FormCard, FormField, FormInput, FormProvider, FormSection, FormSelect, IndividualDetail_default as IndividualDetail, Individuals_default as Individuals, InfoField, IntermediaryCard, IntermediaryFI, IntermediaryFIAddress, JsonViewer, Label, ListPage, MainLayout, MetricCard, NewTransaction, NotFound_default as NotFound, OFAC, OFACAlertView, OriginatorCard, OriginatorFI, OriginatorFIAddress, PageLayout, PatternLibrary, PaymentInformationSection, Popover, PopoverContent, PopoverTrigger, ReceiverCard, ResolveAlertDialog, ResponsiveGrid, ScrollArea, ScrollBar, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stack, Statement, StatementHeader, StatementView, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionDetail_default as TransactionDetail, TransactionHistory_default as TransactionHistory, TransactionTypeBadge, UIKit, UIKitShowcase, WireDetailsSection, WireTransferSection, badgeVariants, buttonVariants, cardVariants, downloadCSV, generateStatementCSV, inputVariants, reducer, textareaVariants, toast, useAlertDetail, useCounterpartyEntity, useEditState, useFormWithEditState, useIsMobile, useSidebar, useToast };
14720
14716
  //# sourceMappingURL=index.js.map
14721
14717
  //# sourceMappingURL=index.js.map