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.cjs +544 -547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +544 -548
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5783,6 +5783,506 @@ var CounterpartiesView = ({
|
|
|
5783
5783
|
] });
|
|
5784
5784
|
};
|
|
5785
5785
|
|
|
5786
|
+
// src/lib/mock-data/counterparty-data.ts
|
|
5787
|
+
var defaultCounterpartyDetail = {
|
|
5788
|
+
email: "contact@acme.com",
|
|
5789
|
+
phone: "+1 (555) 123-4567",
|
|
5790
|
+
dateOfBirth: "1985-03-15",
|
|
5791
|
+
idNumber: "ID-123456789",
|
|
5792
|
+
idType: "product_id",
|
|
5793
|
+
idValue: "PROD-001",
|
|
5794
|
+
address: {
|
|
5795
|
+
line1: "123 Business Ave",
|
|
5796
|
+
line2: "Suite 100",
|
|
5797
|
+
city: "New York",
|
|
5798
|
+
state: "NY",
|
|
5799
|
+
postalCode: "10001",
|
|
5800
|
+
countryCode: "US",
|
|
5801
|
+
type: "MAILING"
|
|
5802
|
+
}
|
|
5803
|
+
};
|
|
5804
|
+
var CounterpartyProfileCard = ({
|
|
5805
|
+
data,
|
|
5806
|
+
onDataChange,
|
|
5807
|
+
isEditing = false,
|
|
5808
|
+
onToggleEdit,
|
|
5809
|
+
hideActions = false,
|
|
5810
|
+
className,
|
|
5811
|
+
onEntityClick
|
|
5812
|
+
}) => {
|
|
5813
|
+
const form = useFormWithEditState({
|
|
5814
|
+
schema: counterpartyDetailSchema,
|
|
5815
|
+
defaultValues: { ...defaultCounterpartyDetail, ...data },
|
|
5816
|
+
initialEditing: isEditing,
|
|
5817
|
+
onToggleEdit,
|
|
5818
|
+
onSave: onDataChange
|
|
5819
|
+
});
|
|
5820
|
+
const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5821
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
5822
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5823
|
+
FormSelect,
|
|
5824
|
+
{
|
|
5825
|
+
name: "idType",
|
|
5826
|
+
label: "Associated with",
|
|
5827
|
+
placeholder: "Select association type",
|
|
5828
|
+
options: [
|
|
5829
|
+
{ value: "product_id", label: "Product ID" },
|
|
5830
|
+
{ value: "business_id", label: "Business ID" },
|
|
5831
|
+
{ value: "individual_id", label: "Individual ID" },
|
|
5832
|
+
{ value: "account_number", label: "Account Number" }
|
|
5833
|
+
]
|
|
5834
|
+
}
|
|
5835
|
+
),
|
|
5836
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5837
|
+
FormInput,
|
|
5838
|
+
{
|
|
5839
|
+
name: "idValue",
|
|
5840
|
+
label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
|
|
5841
|
+
placeholder: "Enter ID value"
|
|
5842
|
+
}
|
|
5843
|
+
),
|
|
5844
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5845
|
+
FormInput,
|
|
5846
|
+
{
|
|
5847
|
+
name: "email",
|
|
5848
|
+
label: "Email",
|
|
5849
|
+
type: "email",
|
|
5850
|
+
placeholder: "Enter email address"
|
|
5851
|
+
}
|
|
5852
|
+
),
|
|
5853
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5854
|
+
FormInput,
|
|
5855
|
+
{
|
|
5856
|
+
name: "phone",
|
|
5857
|
+
label: "Phone Number",
|
|
5858
|
+
type: "tel",
|
|
5859
|
+
placeholder: "Enter phone number"
|
|
5860
|
+
}
|
|
5861
|
+
),
|
|
5862
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5863
|
+
FormInput,
|
|
5864
|
+
{
|
|
5865
|
+
name: "dateOfBirth",
|
|
5866
|
+
label: "Date of Birth",
|
|
5867
|
+
type: "date",
|
|
5868
|
+
placeholder: "Select date of birth"
|
|
5869
|
+
}
|
|
5870
|
+
),
|
|
5871
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5872
|
+
FormInput,
|
|
5873
|
+
{
|
|
5874
|
+
name: "idNumber",
|
|
5875
|
+
label: "ID Number",
|
|
5876
|
+
placeholder: "Enter ID number"
|
|
5877
|
+
}
|
|
5878
|
+
)
|
|
5879
|
+
] }),
|
|
5880
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
|
|
5881
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5882
|
+
FormInput,
|
|
5883
|
+
{
|
|
5884
|
+
name: "address.line1",
|
|
5885
|
+
label: "Street Address",
|
|
5886
|
+
placeholder: "Enter street address"
|
|
5887
|
+
}
|
|
5888
|
+
),
|
|
5889
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5890
|
+
FormInput,
|
|
5891
|
+
{
|
|
5892
|
+
name: "address.line2",
|
|
5893
|
+
label: "Apartment, suite, or floor",
|
|
5894
|
+
placeholder: "Enter apartment, suite, or floor"
|
|
5895
|
+
}
|
|
5896
|
+
)
|
|
5897
|
+
] }),
|
|
5898
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
5899
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5900
|
+
FormInput,
|
|
5901
|
+
{
|
|
5902
|
+
name: "address.city",
|
|
5903
|
+
label: "City",
|
|
5904
|
+
placeholder: "Enter city"
|
|
5905
|
+
}
|
|
5906
|
+
),
|
|
5907
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5908
|
+
FormInput,
|
|
5909
|
+
{
|
|
5910
|
+
name: "address.state",
|
|
5911
|
+
label: "State",
|
|
5912
|
+
placeholder: "Enter state"
|
|
5913
|
+
}
|
|
5914
|
+
),
|
|
5915
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5916
|
+
FormInput,
|
|
5917
|
+
{
|
|
5918
|
+
name: "address.postalCode",
|
|
5919
|
+
label: "Postal Code",
|
|
5920
|
+
placeholder: "Enter postal code"
|
|
5921
|
+
}
|
|
5922
|
+
),
|
|
5923
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5924
|
+
FormInput,
|
|
5925
|
+
{
|
|
5926
|
+
name: "address.countryCode",
|
|
5927
|
+
label: "Country Code",
|
|
5928
|
+
placeholder: "e.g., US"
|
|
5929
|
+
}
|
|
5930
|
+
)
|
|
5931
|
+
] })
|
|
5932
|
+
] }) });
|
|
5933
|
+
const formValues = form.watch();
|
|
5934
|
+
const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
|
|
5935
|
+
const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
5936
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
5937
|
+
/* @__PURE__ */ jsxRuntime.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" }),
|
|
5938
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5939
|
+
InfoField,
|
|
5940
|
+
{
|
|
5941
|
+
label: idTypeLabel,
|
|
5942
|
+
value: formValues?.idValue && formValues?.idType && onEntityClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5943
|
+
"button",
|
|
5944
|
+
{
|
|
5945
|
+
onClick: (e) => {
|
|
5946
|
+
e.preventDefault();
|
|
5947
|
+
onEntityClick(formValues.idType, formValues.idValue);
|
|
5948
|
+
},
|
|
5949
|
+
className: "text-primary hover:underline font-medium text-left cursor-pointer",
|
|
5950
|
+
children: formValues?.idValue || "-"
|
|
5951
|
+
}
|
|
5952
|
+
) : formValues?.idValue || "-",
|
|
5953
|
+
layout: "horizontal"
|
|
5954
|
+
}
|
|
5955
|
+
)
|
|
5956
|
+
] }),
|
|
5957
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
5958
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
|
|
5959
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
|
|
5960
|
+
] }),
|
|
5961
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
5962
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
|
|
5963
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
|
|
5964
|
+
] }),
|
|
5965
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5966
|
+
InfoField,
|
|
5967
|
+
{
|
|
5968
|
+
label: "Address",
|
|
5969
|
+
value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
|
|
5970
|
+
layout: "horizontal"
|
|
5971
|
+
}
|
|
5972
|
+
)
|
|
5973
|
+
] });
|
|
5974
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5975
|
+
EditableFormCard,
|
|
5976
|
+
{
|
|
5977
|
+
title: "Profile Information",
|
|
5978
|
+
variant: "subtle",
|
|
5979
|
+
className,
|
|
5980
|
+
isEditing: form.isEditing,
|
|
5981
|
+
onToggleEdit: form.handleToggleEdit,
|
|
5982
|
+
onSave: form.handleSave,
|
|
5983
|
+
onCancel: form.handleCancel,
|
|
5984
|
+
hideActions,
|
|
5985
|
+
editContent,
|
|
5986
|
+
viewContent
|
|
5987
|
+
}
|
|
5988
|
+
);
|
|
5989
|
+
};
|
|
5990
|
+
var mockCounterpartyTimeline = [
|
|
5991
|
+
{
|
|
5992
|
+
id: "1",
|
|
5993
|
+
action: "Counterparty Created",
|
|
5994
|
+
user: "admin",
|
|
5995
|
+
details: "Initial counterparty setup",
|
|
5996
|
+
status: "Active",
|
|
5997
|
+
timestamp: "2024-01-15 10:30:00"
|
|
5998
|
+
},
|
|
5999
|
+
{
|
|
6000
|
+
id: "2",
|
|
6001
|
+
action: "Profile Updated",
|
|
6002
|
+
user: "admin",
|
|
6003
|
+
details: "Updated counterparty information",
|
|
6004
|
+
timestamp: "2024-01-20 14:22:00"
|
|
6005
|
+
},
|
|
6006
|
+
{
|
|
6007
|
+
id: "3",
|
|
6008
|
+
action: "OFAC Check Completed",
|
|
6009
|
+
user: "System",
|
|
6010
|
+
details: "Automated compliance check",
|
|
6011
|
+
status: "Verified",
|
|
6012
|
+
timestamp: "2024-01-20 14:30:00"
|
|
6013
|
+
}
|
|
6014
|
+
];
|
|
6015
|
+
var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
|
|
6016
|
+
const getIcon = (action) => {
|
|
6017
|
+
if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
|
|
6018
|
+
if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
|
|
6019
|
+
if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
|
|
6020
|
+
if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
|
|
6021
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
|
|
6022
|
+
};
|
|
6023
|
+
const getStatusColor2 = (status) => {
|
|
6024
|
+
switch (status) {
|
|
6025
|
+
case "Active":
|
|
6026
|
+
case "Verified":
|
|
6027
|
+
return "text-success";
|
|
6028
|
+
case "Pending":
|
|
6029
|
+
return "text-warning";
|
|
6030
|
+
default:
|
|
6031
|
+
return "text-muted-foreground";
|
|
6032
|
+
}
|
|
6033
|
+
};
|
|
6034
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6035
|
+
FormCard,
|
|
6036
|
+
{
|
|
6037
|
+
title: "Timeline",
|
|
6038
|
+
className,
|
|
6039
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
|
|
6040
|
+
index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
|
|
6041
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
6042
|
+
"absolute left-0 top-0 flex-none",
|
|
6043
|
+
getStatusColor2(event.status)
|
|
6044
|
+
), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
|
|
6045
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
|
|
6046
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
|
|
6047
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
6048
|
+
"by ",
|
|
6049
|
+
event.user
|
|
6050
|
+
] }),
|
|
6051
|
+
event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
|
|
6052
|
+
event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
|
|
6053
|
+
"Status: ",
|
|
6054
|
+
event.status
|
|
6055
|
+
] }),
|
|
6056
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
|
|
6057
|
+
] })
|
|
6058
|
+
] }, event.id)) })
|
|
6059
|
+
}
|
|
6060
|
+
);
|
|
6061
|
+
};
|
|
6062
|
+
var typeConfig2 = {
|
|
6063
|
+
BUSINESS: {
|
|
6064
|
+
variant: "business",
|
|
6065
|
+
label: "Business",
|
|
6066
|
+
icon: lucideReact.Building2
|
|
6067
|
+
},
|
|
6068
|
+
INDIVIDUAL: {
|
|
6069
|
+
variant: "individual",
|
|
6070
|
+
label: "Individual",
|
|
6071
|
+
icon: lucideReact.User
|
|
6072
|
+
}
|
|
6073
|
+
};
|
|
6074
|
+
var CounterpartyTypeBadge = ({ type, className }) => {
|
|
6075
|
+
const config = typeConfig2[type];
|
|
6076
|
+
if (!config) {
|
|
6077
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className, children: [
|
|
6078
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3 mr-1" }),
|
|
6079
|
+
type || "Unknown"
|
|
6080
|
+
] });
|
|
6081
|
+
}
|
|
6082
|
+
const Icon2 = config.icon;
|
|
6083
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
|
|
6084
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
|
|
6085
|
+
config.label
|
|
6086
|
+
] });
|
|
6087
|
+
};
|
|
6088
|
+
var PaymentMethodCard = ({
|
|
6089
|
+
type,
|
|
6090
|
+
fiId,
|
|
6091
|
+
accountNumber,
|
|
6092
|
+
bankName,
|
|
6093
|
+
accountType,
|
|
6094
|
+
beneficiaryBankName,
|
|
6095
|
+
correspondentBankId,
|
|
6096
|
+
intermediaryBankId,
|
|
6097
|
+
className
|
|
6098
|
+
}) => {
|
|
6099
|
+
const getIcon = () => {
|
|
6100
|
+
switch (type) {
|
|
6101
|
+
case "ACH":
|
|
6102
|
+
return lucideReact.Building2;
|
|
6103
|
+
case "Domestic Wire":
|
|
6104
|
+
return lucideReact.Landmark;
|
|
6105
|
+
case "International Wire":
|
|
6106
|
+
return lucideReact.Globe;
|
|
6107
|
+
default:
|
|
6108
|
+
return lucideReact.Building2;
|
|
6109
|
+
}
|
|
6110
|
+
};
|
|
6111
|
+
const Icon2 = getIcon();
|
|
6112
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
|
|
6113
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
|
|
6114
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6115
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
6116
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: type })
|
|
6117
|
+
] }),
|
|
6118
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4" }) })
|
|
6119
|
+
] }),
|
|
6120
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-3", children: [
|
|
6121
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
6122
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
|
|
6123
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Number", value: accountNumber })
|
|
6124
|
+
] }),
|
|
6125
|
+
type === "ACH" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
6126
|
+
bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
|
|
6127
|
+
accountType && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Type", value: accountType })
|
|
6128
|
+
] }),
|
|
6129
|
+
type === "Domestic Wire" && bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
|
|
6130
|
+
type === "International Wire" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
6131
|
+
beneficiaryBankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
|
|
6132
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
6133
|
+
correspondentBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
|
|
6134
|
+
intermediaryBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
|
|
6135
|
+
] })
|
|
6136
|
+
] })
|
|
6137
|
+
] })
|
|
6138
|
+
] });
|
|
6139
|
+
};
|
|
6140
|
+
var typeClasses = {
|
|
6141
|
+
cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
6142
|
+
forms: "grid-cols-1 lg:grid-cols-2",
|
|
6143
|
+
data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
6144
|
+
custom: ""
|
|
6145
|
+
};
|
|
6146
|
+
var gapClasses = {
|
|
6147
|
+
sm: "gap-3",
|
|
6148
|
+
md: "gap-4",
|
|
6149
|
+
lg: "gap-6",
|
|
6150
|
+
xl: "gap-8"
|
|
6151
|
+
};
|
|
6152
|
+
var ResponsiveGrid = React15__namespace.forwardRef(
|
|
6153
|
+
({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
|
|
6154
|
+
const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
|
|
6155
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6156
|
+
"div",
|
|
6157
|
+
{
|
|
6158
|
+
ref,
|
|
6159
|
+
className: cn(
|
|
6160
|
+
"grid",
|
|
6161
|
+
gridClasses2,
|
|
6162
|
+
gapClasses[gap],
|
|
6163
|
+
className
|
|
6164
|
+
),
|
|
6165
|
+
children
|
|
6166
|
+
}
|
|
6167
|
+
);
|
|
6168
|
+
}
|
|
6169
|
+
);
|
|
6170
|
+
ResponsiveGrid.displayName = "ResponsiveGrid";
|
|
6171
|
+
var CounterpartyDetailView = ({
|
|
6172
|
+
counterpartyName,
|
|
6173
|
+
counterpartyType,
|
|
6174
|
+
currentStatus,
|
|
6175
|
+
isEditingProfile,
|
|
6176
|
+
mockPaymentMethods: mockPaymentMethods2,
|
|
6177
|
+
documents,
|
|
6178
|
+
onStatusChange,
|
|
6179
|
+
onToggleProfileEdit,
|
|
6180
|
+
onAddPaymentMethod,
|
|
6181
|
+
onAddDocument,
|
|
6182
|
+
onEntityClick
|
|
6183
|
+
}) => {
|
|
6184
|
+
const documentColumns = [
|
|
6185
|
+
{
|
|
6186
|
+
key: "name",
|
|
6187
|
+
title: "Document Name",
|
|
6188
|
+
sortable: true,
|
|
6189
|
+
width: "40%"
|
|
6190
|
+
},
|
|
6191
|
+
{
|
|
6192
|
+
key: "type",
|
|
6193
|
+
title: "Type",
|
|
6194
|
+
sortable: true,
|
|
6195
|
+
width: "20%"
|
|
6196
|
+
},
|
|
6197
|
+
{
|
|
6198
|
+
key: "uploadedDate",
|
|
6199
|
+
title: "Uploaded",
|
|
6200
|
+
sortable: true,
|
|
6201
|
+
width: "20%"
|
|
6202
|
+
},
|
|
6203
|
+
{
|
|
6204
|
+
key: "status",
|
|
6205
|
+
title: "Status",
|
|
6206
|
+
sortable: true,
|
|
6207
|
+
width: "20%",
|
|
6208
|
+
align: "right",
|
|
6209
|
+
render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: value })
|
|
6210
|
+
}
|
|
6211
|
+
];
|
|
6212
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6213
|
+
PageLayout,
|
|
6214
|
+
{
|
|
6215
|
+
title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
6216
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: counterpartyName }),
|
|
6217
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6218
|
+
EditableInfoField,
|
|
6219
|
+
{
|
|
6220
|
+
label: "",
|
|
6221
|
+
value: currentStatus,
|
|
6222
|
+
options: [
|
|
6223
|
+
{ value: "ACTIVE", label: "Active" },
|
|
6224
|
+
{ value: "INACTIVE", label: "Inactive" },
|
|
6225
|
+
{ value: "PENDING", label: "Pending" },
|
|
6226
|
+
{ value: "SUSPENDED", label: "Suspended" }
|
|
6227
|
+
],
|
|
6228
|
+
onChange: onStatusChange,
|
|
6229
|
+
renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value }),
|
|
6230
|
+
className: "inline-block"
|
|
6231
|
+
}
|
|
6232
|
+
),
|
|
6233
|
+
/* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: counterpartyType })
|
|
6234
|
+
] }),
|
|
6235
|
+
maxWidth: "full",
|
|
6236
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
|
|
6237
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
6238
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6239
|
+
CounterpartyProfileCard,
|
|
6240
|
+
{
|
|
6241
|
+
isEditing: isEditingProfile,
|
|
6242
|
+
onToggleEdit: onToggleProfileEdit,
|
|
6243
|
+
onEntityClick
|
|
6244
|
+
}
|
|
6245
|
+
),
|
|
6246
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
6247
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
6248
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Payment Methods" }),
|
|
6249
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
|
|
6250
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
|
|
6251
|
+
"Method"
|
|
6252
|
+
] })
|
|
6253
|
+
] }),
|
|
6254
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
6255
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
|
|
6256
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No payment methods configured" })
|
|
6257
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsxRuntime.jsx(PaymentMethodCard, { ...method }, index)) }) })
|
|
6258
|
+
] }),
|
|
6259
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
6260
|
+
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
6261
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
|
|
6262
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
|
|
6263
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
|
|
6264
|
+
"Document"
|
|
6265
|
+
] })
|
|
6266
|
+
] }),
|
|
6267
|
+
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
6268
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
|
|
6269
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents found" })
|
|
6270
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6271
|
+
DataTable,
|
|
6272
|
+
{
|
|
6273
|
+
columns: documentColumns,
|
|
6274
|
+
data: documents
|
|
6275
|
+
}
|
|
6276
|
+
) })
|
|
6277
|
+
] })
|
|
6278
|
+
] }),
|
|
6279
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
|
|
6280
|
+
} }) })
|
|
6281
|
+
] })
|
|
6282
|
+
}
|
|
6283
|
+
);
|
|
6284
|
+
};
|
|
6285
|
+
|
|
5786
6286
|
// src/lib/mock-data/banking-data.ts
|
|
5787
6287
|
var defaultACHBankDetails = {
|
|
5788
6288
|
gatewayRoutingNumber: "043087080",
|
|
@@ -5931,49 +6431,18 @@ var ACHBasicInfoCard = ({
|
|
|
5931
6431
|
title: "Basic Information",
|
|
5932
6432
|
variant: "subtle",
|
|
5933
6433
|
className,
|
|
5934
|
-
isEditing: form.isEditing,
|
|
5935
|
-
onToggleEdit: form.handleToggleEdit,
|
|
5936
|
-
onSave: form.handleSave,
|
|
5937
|
-
onCancel: form.handleCancel,
|
|
5938
|
-
hideActions,
|
|
5939
|
-
isFormValid: form.isFormValid,
|
|
5940
|
-
isDirty: form.isDirty,
|
|
5941
|
-
editContent,
|
|
5942
|
-
viewContent
|
|
5943
|
-
}
|
|
5944
|
-
);
|
|
5945
|
-
};
|
|
5946
|
-
var typeClasses = {
|
|
5947
|
-
cards: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
5948
|
-
forms: "grid-cols-1 lg:grid-cols-2",
|
|
5949
|
-
data: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
5950
|
-
custom: ""
|
|
5951
|
-
};
|
|
5952
|
-
var gapClasses = {
|
|
5953
|
-
sm: "gap-3",
|
|
5954
|
-
md: "gap-4",
|
|
5955
|
-
lg: "gap-6",
|
|
5956
|
-
xl: "gap-8"
|
|
5957
|
-
};
|
|
5958
|
-
var ResponsiveGrid = React15__namespace.forwardRef(
|
|
5959
|
-
({ children, type = "cards", gap = "md", editMode = false, className }, ref) => {
|
|
5960
|
-
const gridClasses2 = editMode ? "grid-cols-1" : typeClasses[type];
|
|
5961
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5962
|
-
"div",
|
|
5963
|
-
{
|
|
5964
|
-
ref,
|
|
5965
|
-
className: cn(
|
|
5966
|
-
"grid",
|
|
5967
|
-
gridClasses2,
|
|
5968
|
-
gapClasses[gap],
|
|
5969
|
-
className
|
|
5970
|
-
),
|
|
5971
|
-
children
|
|
5972
|
-
}
|
|
5973
|
-
);
|
|
5974
|
-
}
|
|
5975
|
-
);
|
|
5976
|
-
ResponsiveGrid.displayName = "ResponsiveGrid";
|
|
6434
|
+
isEditing: form.isEditing,
|
|
6435
|
+
onToggleEdit: form.handleToggleEdit,
|
|
6436
|
+
onSave: form.handleSave,
|
|
6437
|
+
onCancel: form.handleCancel,
|
|
6438
|
+
hideActions,
|
|
6439
|
+
isFormValid: form.isFormValid,
|
|
6440
|
+
isDirty: form.isDirty,
|
|
6441
|
+
editContent,
|
|
6442
|
+
viewContent
|
|
6443
|
+
}
|
|
6444
|
+
);
|
|
6445
|
+
};
|
|
5977
6446
|
var BankAddressCard = ({
|
|
5978
6447
|
data,
|
|
5979
6448
|
onDataChange,
|
|
@@ -6190,32 +6659,6 @@ var BankingDetailsCard = ({ isEditing, onToggleEdit, className }) => {
|
|
|
6190
6659
|
}
|
|
6191
6660
|
);
|
|
6192
6661
|
};
|
|
6193
|
-
var typeConfig2 = {
|
|
6194
|
-
BUSINESS: {
|
|
6195
|
-
variant: "business",
|
|
6196
|
-
label: "Business",
|
|
6197
|
-
icon: lucideReact.Building2
|
|
6198
|
-
},
|
|
6199
|
-
INDIVIDUAL: {
|
|
6200
|
-
variant: "individual",
|
|
6201
|
-
label: "Individual",
|
|
6202
|
-
icon: lucideReact.User
|
|
6203
|
-
}
|
|
6204
|
-
};
|
|
6205
|
-
var CounterpartyTypeBadge = ({ type, className }) => {
|
|
6206
|
-
const config = typeConfig2[type];
|
|
6207
|
-
if (!config) {
|
|
6208
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className, children: [
|
|
6209
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, { className: "w-3 h-3 mr-1" }),
|
|
6210
|
-
type || "Unknown"
|
|
6211
|
-
] });
|
|
6212
|
-
}
|
|
6213
|
-
const Icon2 = config.icon;
|
|
6214
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: config.variant, className, children: [
|
|
6215
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "w-3 h-3 mr-1" }),
|
|
6216
|
-
config.label
|
|
6217
|
-
] });
|
|
6218
|
-
};
|
|
6219
6662
|
var BasicInfoCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
|
|
6220
6663
|
const [name, setName] = React15.useState("John wire hot");
|
|
6221
6664
|
const [status, setStatus] = React15.useState("ACTIVE");
|
|
@@ -6274,245 +6717,26 @@ var BasicInfoCard = ({ isEditing, onToggleEdit, className, hideActions }) => {
|
|
|
6274
6717
|
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022", layout: "horizontal" }),
|
|
6275
6718
|
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: "SSN", layout: "horizontal" }),
|
|
6276
6719
|
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: "1985-8-20", layout: "horizontal" }),
|
|
6277
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
|
|
6278
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
|
|
6279
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
|
|
6280
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
|
|
6281
|
-
] }),
|
|
6282
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
|
|
6283
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
|
|
6284
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6285
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
|
|
6286
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
|
|
6287
|
-
] })
|
|
6288
|
-
] })
|
|
6289
|
-
] });
|
|
6290
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6291
|
-
EditableFormCard,
|
|
6292
|
-
{
|
|
6293
|
-
title: "Basic Info",
|
|
6294
|
-
className,
|
|
6295
|
-
isEditing,
|
|
6296
|
-
onToggleEdit,
|
|
6297
|
-
hideActions,
|
|
6298
|
-
editContent,
|
|
6299
|
-
viewContent
|
|
6300
|
-
}
|
|
6301
|
-
);
|
|
6302
|
-
};
|
|
6303
|
-
|
|
6304
|
-
// src/lib/mock-data/counterparty-data.ts
|
|
6305
|
-
var defaultCounterpartyDetail = {
|
|
6306
|
-
email: "contact@acme.com",
|
|
6307
|
-
phone: "+1 (555) 123-4567",
|
|
6308
|
-
dateOfBirth: "1985-03-15",
|
|
6309
|
-
idNumber: "ID-123456789",
|
|
6310
|
-
idType: "product_id",
|
|
6311
|
-
idValue: "PROD-001",
|
|
6312
|
-
address: {
|
|
6313
|
-
line1: "123 Business Ave",
|
|
6314
|
-
line2: "Suite 100",
|
|
6315
|
-
city: "New York",
|
|
6316
|
-
state: "NY",
|
|
6317
|
-
postalCode: "10001",
|
|
6318
|
-
countryCode: "US",
|
|
6319
|
-
type: "MAILING"
|
|
6320
|
-
}
|
|
6321
|
-
};
|
|
6322
|
-
var CounterpartyProfileCard = ({
|
|
6323
|
-
data,
|
|
6324
|
-
onDataChange,
|
|
6325
|
-
isEditing = false,
|
|
6326
|
-
onToggleEdit,
|
|
6327
|
-
hideActions = false,
|
|
6328
|
-
className
|
|
6329
|
-
}) => {
|
|
6330
|
-
const navigate = reactRouterDom.useNavigate();
|
|
6331
|
-
const form = useFormWithEditState({
|
|
6332
|
-
schema: counterpartyDetailSchema,
|
|
6333
|
-
defaultValues: { ...defaultCounterpartyDetail, ...data },
|
|
6334
|
-
initialEditing: isEditing,
|
|
6335
|
-
onToggleEdit,
|
|
6336
|
-
onSave: onDataChange
|
|
6337
|
-
});
|
|
6338
|
-
const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
6339
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6340
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6341
|
-
FormSelect,
|
|
6342
|
-
{
|
|
6343
|
-
name: "idType",
|
|
6344
|
-
label: "Associated with",
|
|
6345
|
-
placeholder: "Select association type",
|
|
6346
|
-
options: [
|
|
6347
|
-
{ value: "product_id", label: "Product ID" },
|
|
6348
|
-
{ value: "business_id", label: "Business ID" },
|
|
6349
|
-
{ value: "individual_id", label: "Individual ID" },
|
|
6350
|
-
{ value: "account_number", label: "Account Number" }
|
|
6351
|
-
]
|
|
6352
|
-
}
|
|
6353
|
-
),
|
|
6354
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6355
|
-
FormInput,
|
|
6356
|
-
{
|
|
6357
|
-
name: "idValue",
|
|
6358
|
-
label: form.watch("idType") === "product_id" ? "Product ID" : form.watch("idType") === "business_id" ? "Business ID" : form.watch("idType") === "individual_id" ? "Individual ID" : "Account Number",
|
|
6359
|
-
placeholder: "Enter ID value"
|
|
6360
|
-
}
|
|
6361
|
-
),
|
|
6362
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6363
|
-
FormInput,
|
|
6364
|
-
{
|
|
6365
|
-
name: "email",
|
|
6366
|
-
label: "Email",
|
|
6367
|
-
type: "email",
|
|
6368
|
-
placeholder: "Enter email address"
|
|
6369
|
-
}
|
|
6370
|
-
),
|
|
6371
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6372
|
-
FormInput,
|
|
6373
|
-
{
|
|
6374
|
-
name: "phone",
|
|
6375
|
-
label: "Phone Number",
|
|
6376
|
-
type: "tel",
|
|
6377
|
-
placeholder: "Enter phone number"
|
|
6378
|
-
}
|
|
6379
|
-
),
|
|
6380
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6381
|
-
FormInput,
|
|
6382
|
-
{
|
|
6383
|
-
name: "dateOfBirth",
|
|
6384
|
-
label: "Date of Birth",
|
|
6385
|
-
type: "date",
|
|
6386
|
-
placeholder: "Select date of birth"
|
|
6387
|
-
}
|
|
6388
|
-
),
|
|
6389
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6390
|
-
FormInput,
|
|
6391
|
-
{
|
|
6392
|
-
name: "idNumber",
|
|
6393
|
-
label: "ID Number",
|
|
6394
|
-
placeholder: "Enter ID number"
|
|
6395
|
-
}
|
|
6396
|
-
)
|
|
6397
|
-
] }),
|
|
6398
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
|
|
6399
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6400
|
-
FormInput,
|
|
6401
|
-
{
|
|
6402
|
-
name: "address.line1",
|
|
6403
|
-
label: "Street Address",
|
|
6404
|
-
placeholder: "Enter street address"
|
|
6405
|
-
}
|
|
6406
|
-
),
|
|
6407
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6408
|
-
FormInput,
|
|
6409
|
-
{
|
|
6410
|
-
name: "address.line2",
|
|
6411
|
-
label: "Apartment, suite, or floor",
|
|
6412
|
-
placeholder: "Enter apartment, suite, or floor"
|
|
6413
|
-
}
|
|
6414
|
-
)
|
|
6415
|
-
] }),
|
|
6416
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
6417
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6418
|
-
FormInput,
|
|
6419
|
-
{
|
|
6420
|
-
name: "address.city",
|
|
6421
|
-
label: "City",
|
|
6422
|
-
placeholder: "Enter city"
|
|
6423
|
-
}
|
|
6424
|
-
),
|
|
6425
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6426
|
-
FormInput,
|
|
6427
|
-
{
|
|
6428
|
-
name: "address.state",
|
|
6429
|
-
label: "State",
|
|
6430
|
-
placeholder: "Enter state"
|
|
6431
|
-
}
|
|
6432
|
-
),
|
|
6433
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6434
|
-
FormInput,
|
|
6435
|
-
{
|
|
6436
|
-
name: "address.postalCode",
|
|
6437
|
-
label: "Postal Code",
|
|
6438
|
-
placeholder: "Enter postal code"
|
|
6439
|
-
}
|
|
6440
|
-
),
|
|
6441
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6442
|
-
FormInput,
|
|
6443
|
-
{
|
|
6444
|
-
name: "address.countryCode",
|
|
6445
|
-
label: "Country Code",
|
|
6446
|
-
placeholder: "e.g., US"
|
|
6447
|
-
}
|
|
6448
|
-
)
|
|
6449
|
-
] })
|
|
6450
|
-
] }) });
|
|
6451
|
-
const formValues = form.watch();
|
|
6452
|
-
const idTypeLabel = formValues?.idType === "product_id" ? "Product ID" : formValues?.idType === "business_id" ? "Business ID" : formValues?.idType === "individual_id" ? "Individual ID" : "Account Number";
|
|
6453
|
-
const getEntityLink = () => {
|
|
6454
|
-
if (!formValues?.idValue) return null;
|
|
6455
|
-
switch (formValues?.idType) {
|
|
6456
|
-
case "business_id":
|
|
6457
|
-
return `/business/${formValues.idValue}`;
|
|
6458
|
-
case "individual_id":
|
|
6459
|
-
return `/individual/${formValues.idValue}`;
|
|
6460
|
-
case "account_number":
|
|
6461
|
-
return `/account/${formValues.idValue}`;
|
|
6462
|
-
default:
|
|
6463
|
-
return null;
|
|
6464
|
-
}
|
|
6465
|
-
};
|
|
6466
|
-
const entityLink = getEntityLink();
|
|
6467
|
-
const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
6468
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6469
|
-
/* @__PURE__ */ jsxRuntime.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" }),
|
|
6470
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6471
|
-
InfoField,
|
|
6472
|
-
{
|
|
6473
|
-
label: idTypeLabel,
|
|
6474
|
-
value: entityLink ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6475
|
-
"button",
|
|
6476
|
-
{
|
|
6477
|
-
onClick: (e) => {
|
|
6478
|
-
e.preventDefault();
|
|
6479
|
-
navigate(entityLink);
|
|
6480
|
-
},
|
|
6481
|
-
className: "text-primary hover:underline font-medium text-left cursor-pointer",
|
|
6482
|
-
children: formValues?.idValue || "-"
|
|
6483
|
-
}
|
|
6484
|
-
) : formValues?.idValue || "-",
|
|
6485
|
-
layout: "horizontal"
|
|
6486
|
-
}
|
|
6487
|
-
)
|
|
6488
|
-
] }),
|
|
6489
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6490
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Email", value: formValues?.email || "-", layout: "horizontal" }),
|
|
6491
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: formValues?.phone || "-", layout: "horizontal" })
|
|
6492
|
-
] }),
|
|
6493
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6494
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Date of Birth", value: formValues?.dateOfBirth || "-", layout: "horizontal" }),
|
|
6495
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Number", value: formValues?.idNumber || "-", layout: "horizontal" })
|
|
6496
|
-
] }),
|
|
6497
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6498
|
-
InfoField,
|
|
6499
|
-
{
|
|
6500
|
-
label: "Address",
|
|
6501
|
-
value: formValues?.address ? `${formValues.address.line1 || ""}${formValues.address.line2 ? ", " + formValues.address.line2 : ""}, ${formValues.address.city || ""}, ${formValues.address.state || ""} ${formValues.address.postalCode || ""}, ${formValues.address.countryCode || ""}` : "-",
|
|
6502
|
-
layout: "horizontal"
|
|
6503
|
-
}
|
|
6504
|
-
)
|
|
6720
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created By", value: "admin", layout: "horizontal" }),
|
|
6721
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: "2025-07-14", layout: "horizontal" }),
|
|
6722
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated By", value: "admin", layout: "horizontal" }),
|
|
6723
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated At", value: "2025-07-14", layout: "horizontal" })
|
|
6724
|
+
] }),
|
|
6725
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-border", children: [
|
|
6726
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground mb-2", children: "OFAC Details" }),
|
|
6727
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
6728
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC date", value: "2025-07-14", layout: "horizontal" }),
|
|
6729
|
+
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC status", value: "Verified", layout: "horizontal" })
|
|
6730
|
+
] })
|
|
6731
|
+
] })
|
|
6505
6732
|
] });
|
|
6506
6733
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6507
6734
|
EditableFormCard,
|
|
6508
6735
|
{
|
|
6509
|
-
title: "
|
|
6510
|
-
variant: "subtle",
|
|
6736
|
+
title: "Basic Info",
|
|
6511
6737
|
className,
|
|
6512
|
-
isEditing
|
|
6513
|
-
onToggleEdit
|
|
6514
|
-
onSave: form.handleSave,
|
|
6515
|
-
onCancel: form.handleCancel,
|
|
6738
|
+
isEditing,
|
|
6739
|
+
onToggleEdit,
|
|
6516
6740
|
hideActions,
|
|
6517
6741
|
editContent,
|
|
6518
6742
|
viewContent
|
|
@@ -11317,205 +11541,6 @@ var Counterparties = () => {
|
|
|
11317
11541
|
);
|
|
11318
11542
|
};
|
|
11319
11543
|
var Counterparties_default = Counterparties;
|
|
11320
|
-
var mockCounterpartyTimeline = [
|
|
11321
|
-
{
|
|
11322
|
-
id: "1",
|
|
11323
|
-
action: "Counterparty Created",
|
|
11324
|
-
user: "admin",
|
|
11325
|
-
details: "Initial counterparty setup",
|
|
11326
|
-
status: "Active",
|
|
11327
|
-
timestamp: "2024-01-15 10:30:00"
|
|
11328
|
-
},
|
|
11329
|
-
{
|
|
11330
|
-
id: "2",
|
|
11331
|
-
action: "Profile Updated",
|
|
11332
|
-
user: "admin",
|
|
11333
|
-
details: "Updated counterparty information",
|
|
11334
|
-
timestamp: "2024-01-20 14:22:00"
|
|
11335
|
-
},
|
|
11336
|
-
{
|
|
11337
|
-
id: "3",
|
|
11338
|
-
action: "OFAC Check Completed",
|
|
11339
|
-
user: "System",
|
|
11340
|
-
details: "Automated compliance check",
|
|
11341
|
-
status: "Verified",
|
|
11342
|
-
timestamp: "2024-01-20 14:30:00"
|
|
11343
|
-
}
|
|
11344
|
-
];
|
|
11345
|
-
var CounterpartyStatusCard = ({ isEditing, onToggleEdit, className }) => {
|
|
11346
|
-
const getIcon = (action) => {
|
|
11347
|
-
if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
|
|
11348
|
-
if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
|
|
11349
|
-
if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
|
|
11350
|
-
if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
|
|
11351
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
|
|
11352
|
-
};
|
|
11353
|
-
const getStatusColor2 = (status) => {
|
|
11354
|
-
switch (status) {
|
|
11355
|
-
case "Active":
|
|
11356
|
-
case "Verified":
|
|
11357
|
-
return "text-success";
|
|
11358
|
-
case "Pending":
|
|
11359
|
-
return "text-warning";
|
|
11360
|
-
default:
|
|
11361
|
-
return "text-muted-foreground";
|
|
11362
|
-
}
|
|
11363
|
-
};
|
|
11364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11365
|
-
FormCard,
|
|
11366
|
-
{
|
|
11367
|
-
title: "Timeline",
|
|
11368
|
-
className,
|
|
11369
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: mockCounterpartyTimeline.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
|
|
11370
|
-
index !== mockCounterpartyTimeline.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
|
|
11371
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
11372
|
-
"absolute left-0 top-0 flex-none",
|
|
11373
|
-
getStatusColor2(event.status)
|
|
11374
|
-
), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
|
|
11375
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
|
|
11376
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
|
|
11377
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
11378
|
-
"by ",
|
|
11379
|
-
event.user
|
|
11380
|
-
] }),
|
|
11381
|
-
event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
|
|
11382
|
-
event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
|
|
11383
|
-
"Status: ",
|
|
11384
|
-
event.status
|
|
11385
|
-
] }),
|
|
11386
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
|
|
11387
|
-
] })
|
|
11388
|
-
] }, event.id)) })
|
|
11389
|
-
}
|
|
11390
|
-
);
|
|
11391
|
-
};
|
|
11392
|
-
var PaymentMethodCard = ({
|
|
11393
|
-
type,
|
|
11394
|
-
fiId,
|
|
11395
|
-
accountNumber,
|
|
11396
|
-
bankName,
|
|
11397
|
-
accountType,
|
|
11398
|
-
beneficiaryBankName,
|
|
11399
|
-
correspondentBankId,
|
|
11400
|
-
intermediaryBankId,
|
|
11401
|
-
className
|
|
11402
|
-
}) => {
|
|
11403
|
-
const getIcon = () => {
|
|
11404
|
-
switch (type) {
|
|
11405
|
-
case "ACH":
|
|
11406
|
-
return lucideReact.Building2;
|
|
11407
|
-
case "Domestic Wire":
|
|
11408
|
-
return lucideReact.Landmark;
|
|
11409
|
-
case "International Wire":
|
|
11410
|
-
return lucideReact.Globe;
|
|
11411
|
-
default:
|
|
11412
|
-
return lucideReact.Building2;
|
|
11413
|
-
}
|
|
11414
|
-
};
|
|
11415
|
-
const Icon2 = getIcon();
|
|
11416
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: cn("hover:bg-muted/50 transition-colors", className), children: [
|
|
11417
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-start justify-between space-y-0 pb-3", children: [
|
|
11418
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11419
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
11420
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: type })
|
|
11421
|
-
] }),
|
|
11422
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVertical, { className: "h-4 w-4" }) })
|
|
11423
|
-
] }),
|
|
11424
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-3", children: [
|
|
11425
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
11426
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary FI ID", value: fiId }),
|
|
11427
|
-
/* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Number", value: accountNumber })
|
|
11428
|
-
] }),
|
|
11429
|
-
type === "ACH" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
11430
|
-
bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
|
|
11431
|
-
accountType && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Account Type", value: accountType })
|
|
11432
|
-
] }),
|
|
11433
|
-
type === "Domestic Wire" && bankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Bank Name", value: bankName }),
|
|
11434
|
-
type === "International Wire" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
11435
|
-
beneficiaryBankName && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Beneficiary Bank Name", value: beneficiaryBankName }),
|
|
11436
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
11437
|
-
correspondentBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Correspondent Bank ID", value: correspondentBankId }),
|
|
11438
|
-
intermediaryBankId && /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
|
|
11439
|
-
] })
|
|
11440
|
-
] })
|
|
11441
|
-
] })
|
|
11442
|
-
] });
|
|
11443
|
-
};
|
|
11444
|
-
var CounterpartyDetailView = ({
|
|
11445
|
-
counterpartyName,
|
|
11446
|
-
counterpartyType,
|
|
11447
|
-
currentStatus,
|
|
11448
|
-
isEditingProfile,
|
|
11449
|
-
mockPaymentMethods: mockPaymentMethods2,
|
|
11450
|
-
documentsTable,
|
|
11451
|
-
onStatusChange,
|
|
11452
|
-
onToggleProfileEdit,
|
|
11453
|
-
onAddPaymentMethod,
|
|
11454
|
-
onAddDocument
|
|
11455
|
-
}) => {
|
|
11456
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11457
|
-
PageLayout,
|
|
11458
|
-
{
|
|
11459
|
-
title: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
11460
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: counterpartyName }),
|
|
11461
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11462
|
-
EditableInfoField,
|
|
11463
|
-
{
|
|
11464
|
-
label: "",
|
|
11465
|
-
value: currentStatus,
|
|
11466
|
-
options: [
|
|
11467
|
-
{ value: "ACTIVE", label: "Active" },
|
|
11468
|
-
{ value: "INACTIVE", label: "Inactive" },
|
|
11469
|
-
{ value: "PENDING", label: "Pending" },
|
|
11470
|
-
{ value: "SUSPENDED", label: "Suspended" }
|
|
11471
|
-
],
|
|
11472
|
-
onChange: onStatusChange,
|
|
11473
|
-
renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value }),
|
|
11474
|
-
className: "inline-block"
|
|
11475
|
-
}
|
|
11476
|
-
),
|
|
11477
|
-
/* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: counterpartyType })
|
|
11478
|
-
] }),
|
|
11479
|
-
maxWidth: "full",
|
|
11480
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
|
|
11481
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
11482
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11483
|
-
CounterpartyProfileCard,
|
|
11484
|
-
{
|
|
11485
|
-
isEditing: isEditingProfile,
|
|
11486
|
-
onToggleEdit: onToggleProfileEdit
|
|
11487
|
-
}
|
|
11488
|
-
),
|
|
11489
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
11490
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
11491
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Payment Methods" }),
|
|
11492
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddPaymentMethod, children: [
|
|
11493
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
|
|
11494
|
-
"Method"
|
|
11495
|
-
] })
|
|
11496
|
-
] }),
|
|
11497
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: mockPaymentMethods2.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
11498
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wallet, { className: "h-5 w-5 opacity-50" }),
|
|
11499
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No payment methods configured" })
|
|
11500
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods2.map((method, index) => /* @__PURE__ */ jsxRuntime.jsx(PaymentMethodCard, { ...method }, index)) }) })
|
|
11501
|
-
] }),
|
|
11502
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
|
|
11503
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
11504
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Documents" }),
|
|
11505
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "sm", variant: "ghost", onClick: onAddDocument, children: [
|
|
11506
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4 mr-1" }),
|
|
11507
|
-
"Document"
|
|
11508
|
-
] })
|
|
11509
|
-
] }),
|
|
11510
|
-
/* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: documentsTable })
|
|
11511
|
-
] })
|
|
11512
|
-
] }),
|
|
11513
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
|
|
11514
|
-
} }) })
|
|
11515
|
-
] })
|
|
11516
|
-
}
|
|
11517
|
-
);
|
|
11518
|
-
};
|
|
11519
11544
|
var mockPaymentMethods = [
|
|
11520
11545
|
{
|
|
11521
11546
|
type: "ACH",
|
|
@@ -11541,39 +11566,24 @@ var mockPaymentMethods = [
|
|
|
11541
11566
|
];
|
|
11542
11567
|
var CounterpartyDetail = () => {
|
|
11543
11568
|
const { id } = reactRouterDom.useParams();
|
|
11544
|
-
reactRouterDom.useNavigate();
|
|
11569
|
+
const navigate = reactRouterDom.useNavigate();
|
|
11545
11570
|
const counterparty = mockCounterpartiesList.find((c) => c.id === id);
|
|
11546
11571
|
const counterpartyDocuments = id ? mockBusinessDocuments[id] || [] : [];
|
|
11547
11572
|
const [currentStatus, setCurrentStatus] = React15.useState(counterparty?.status || "ACTIVE");
|
|
11548
11573
|
const [isEditingProfile, setIsEditingProfile] = React15.useState(false);
|
|
11549
|
-
const
|
|
11550
|
-
{
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
width: "20%"
|
|
11561
|
-
},
|
|
11562
|
-
{
|
|
11563
|
-
key: "uploadedDate",
|
|
11564
|
-
title: "Uploaded",
|
|
11565
|
-
sortable: true,
|
|
11566
|
-
width: "20%"
|
|
11567
|
-
},
|
|
11568
|
-
{
|
|
11569
|
-
key: "status",
|
|
11570
|
-
title: "Status",
|
|
11571
|
-
sortable: true,
|
|
11572
|
-
width: "20%",
|
|
11573
|
-
align: "right",
|
|
11574
|
-
render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: value })
|
|
11574
|
+
const handleEntityClick = (entityType, entityId) => {
|
|
11575
|
+
switch (entityType) {
|
|
11576
|
+
case "business_id":
|
|
11577
|
+
navigate(`/business/${entityId}`);
|
|
11578
|
+
break;
|
|
11579
|
+
case "individual_id":
|
|
11580
|
+
navigate(`/individual/${entityId}`);
|
|
11581
|
+
break;
|
|
11582
|
+
case "account_number":
|
|
11583
|
+
navigate(`/account/${entityId}`);
|
|
11584
|
+
break;
|
|
11575
11585
|
}
|
|
11576
|
-
|
|
11586
|
+
};
|
|
11577
11587
|
const handleStatusChange = (newStatus) => {
|
|
11578
11588
|
setCurrentStatus(newStatus);
|
|
11579
11589
|
};
|
|
@@ -11586,21 +11596,6 @@ var CounterpartyDetail = () => {
|
|
|
11586
11596
|
const handleAddDocument = () => {
|
|
11587
11597
|
console.log("Add document");
|
|
11588
11598
|
};
|
|
11589
|
-
const documentsTable = React15.useMemo(() => {
|
|
11590
|
-
if (counterpartyDocuments.length === 0) {
|
|
11591
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
11592
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5 opacity-50" }),
|
|
11593
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents found" })
|
|
11594
|
-
] });
|
|
11595
|
-
}
|
|
11596
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11597
|
-
DataTable,
|
|
11598
|
-
{
|
|
11599
|
-
columns: documentColumns,
|
|
11600
|
-
data: counterpartyDocuments
|
|
11601
|
-
}
|
|
11602
|
-
);
|
|
11603
|
-
}, [counterpartyDocuments, documentColumns]);
|
|
11604
11599
|
if (!counterparty) {
|
|
11605
11600
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
11606
11601
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold mb-2", children: "Counterparty Not Found" }),
|
|
@@ -11615,11 +11610,12 @@ var CounterpartyDetail = () => {
|
|
|
11615
11610
|
currentStatus,
|
|
11616
11611
|
isEditingProfile,
|
|
11617
11612
|
mockPaymentMethods,
|
|
11618
|
-
|
|
11613
|
+
documents: counterpartyDocuments,
|
|
11619
11614
|
onStatusChange: handleStatusChange,
|
|
11620
11615
|
onToggleProfileEdit: handleToggleProfileEdit,
|
|
11621
11616
|
onAddPaymentMethod: handleAddPaymentMethod,
|
|
11622
|
-
onAddDocument: handleAddDocument
|
|
11617
|
+
onAddDocument: handleAddDocument,
|
|
11618
|
+
onEntityClick: handleEntityClick
|
|
11623
11619
|
}
|
|
11624
11620
|
);
|
|
11625
11621
|
};
|
|
@@ -14798,6 +14794,7 @@ exports.Counterparties = Counterparties_default;
|
|
|
14798
14794
|
exports.CounterpartiesView = CounterpartiesView;
|
|
14799
14795
|
exports.CounterpartyBasicInfo = CounterpartyBasicInfo;
|
|
14800
14796
|
exports.CounterpartyDetail = CounterpartyDetail_default;
|
|
14797
|
+
exports.CounterpartyDetailView = CounterpartyDetailView;
|
|
14801
14798
|
exports.CounterpartyProfileCard = CounterpartyProfileCard;
|
|
14802
14799
|
exports.CounterpartyRecordsCard = CounterpartyRecordsCard;
|
|
14803
14800
|
exports.CounterpartyTypeBadge = CounterpartyTypeBadge;
|