braid-ui 1.0.43 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6188,10 +6188,12 @@ var CounterpartyDetailView = ({
6188
6188
  counterpartyType,
6189
6189
  currentStatus,
6190
6190
  isEditingProfile,
6191
+ counterpartyProfileData,
6191
6192
  mockPaymentMethods: mockPaymentMethods2,
6192
6193
  documents,
6193
6194
  onStatusChange,
6194
6195
  onToggleProfileEdit,
6196
+ onProfileDataChange,
6195
6197
  onAddPaymentMethod,
6196
6198
  onAddDocument,
6197
6199
  onEntityClick
@@ -6254,8 +6256,10 @@ var CounterpartyDetailView = ({
6254
6256
  /* @__PURE__ */ jsxRuntime.jsx(
6255
6257
  CounterpartyProfileCard,
6256
6258
  {
6259
+ data: counterpartyProfileData,
6257
6260
  isEditing: isEditingProfile,
6258
6261
  onToggleEdit: onToggleProfileEdit,
6262
+ onDataChange: onProfileDataChange,
6259
6263
  onEntityClick
6260
6264
  }
6261
6265
  ),
@@ -11587,6 +11591,60 @@ var CounterpartyDetail = () => {
11587
11591
  const counterpartyDocuments = id ? mockBusinessDocuments[id] || [] : [];
11588
11592
  const [currentStatus, setCurrentStatus] = React15.useState(counterparty?.status || "ACTIVE");
11589
11593
  const [isEditingProfile, setIsEditingProfile] = React15.useState(false);
11594
+ const getInitialProfileData = () => {
11595
+ if (!counterparty) {
11596
+ return {
11597
+ idType: "product_id",
11598
+ idValue: "",
11599
+ email: "",
11600
+ phone: "",
11601
+ dateOfBirth: "",
11602
+ idNumber: "",
11603
+ address: {
11604
+ line1: "",
11605
+ line2: "",
11606
+ city: "",
11607
+ state: "",
11608
+ postalCode: "",
11609
+ countryCode: "US",
11610
+ type: ""
11611
+ }
11612
+ };
11613
+ }
11614
+ let idType = "product_id";
11615
+ let idValue = "";
11616
+ if (counterparty.productId) {
11617
+ idType = "product_id";
11618
+ idValue = counterparty.productId;
11619
+ } else if (counterparty.businessId) {
11620
+ idType = "business_id";
11621
+ idValue = counterparty.businessId;
11622
+ } else if (counterparty.individualId) {
11623
+ idType = "individual_id";
11624
+ idValue = counterparty.individualId;
11625
+ } else if (counterparty.accountNumber) {
11626
+ idType = "account_number";
11627
+ idValue = counterparty.accountNumber;
11628
+ }
11629
+ return {
11630
+ idType,
11631
+ idValue,
11632
+ email: "",
11633
+ phone: "",
11634
+ dateOfBirth: "",
11635
+ idNumber: "",
11636
+ address: {
11637
+ line1: "",
11638
+ line2: "",
11639
+ city: "",
11640
+ state: "",
11641
+ postalCode: "",
11642
+ countryCode: "US",
11643
+ type: ""
11644
+ }
11645
+ };
11646
+ };
11647
+ const [counterpartyProfileData, setCounterpartyProfileData] = React15.useState(getInitialProfileData());
11590
11648
  const handleEntityClick = (entityType, entityId) => {
11591
11649
  switch (entityType) {
11592
11650
  case "business_id":
@@ -11606,6 +11664,9 @@ var CounterpartyDetail = () => {
11606
11664
  const handleToggleProfileEdit = () => {
11607
11665
  setIsEditingProfile(!isEditingProfile);
11608
11666
  };
11667
+ const handleProfileDataChange = (newData) => {
11668
+ setCounterpartyProfileData(newData);
11669
+ };
11609
11670
  const handleAddPaymentMethod = () => {
11610
11671
  console.log("Add payment method");
11611
11672
  };
@@ -11625,10 +11686,12 @@ var CounterpartyDetail = () => {
11625
11686
  counterpartyType: counterparty.type,
11626
11687
  currentStatus,
11627
11688
  isEditingProfile,
11689
+ counterpartyProfileData,
11628
11690
  mockPaymentMethods,
11629
11691
  documents: counterpartyDocuments,
11630
11692
  onStatusChange: handleStatusChange,
11631
11693
  onToggleProfileEdit: handleToggleProfileEdit,
11694
+ onProfileDataChange: handleProfileDataChange,
11632
11695
  onAddPaymentMethod: handleAddPaymentMethod,
11633
11696
  onAddDocument: handleAddDocument,
11634
11697
  onEntityClick: handleEntityClick