braid-ui 1.0.38 → 1.0.39
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/css/braid-ui.css +31 -0
- package/dist/css/braid-ui.min.css +1 -1
- package/dist/index.cjs +1195 -491
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1198 -495
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React15 from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp,
|
|
7
|
+
import { ChevronDown, ChevronUp, Check, X, PanelLeft, Edit, Home, Globe, CreditCard, Building, MoreVertical, Minus, TrendingDown, TrendingUp, ChevronRight, Eye, Trash2, Plus, MessageSquare, Upload, FileText, Download, Copy, LayoutDashboard, Bell, Briefcase, FileCheck, Receipt, ArrowLeftRight, Users, Building2, Shield, AlertCircle, RefreshCw, Landmark, Search, Repeat, Zap, Box, Settings, BarChart3, Key, ChevronLeft, AlertTriangle, XCircle, CheckCircle, Clock, Ban, Circle, Wallet, Filter, User, Loader2, ArrowDownRight, ArrowUpRight, CheckCircle2, StickyNote, FileUp, RotateCcw, Send, PlayCircle, UserPlus, ChevronsUpDown, UserCheck, CalendarIcon, Package, FileJson, DollarSign } from 'lucide-react';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -18,14 +18,14 @@ import { z } from 'zod';
|
|
|
18
18
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@radix-ui/react-collapsible';
|
|
19
19
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
20
20
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
21
|
-
import { format } from 'date-fns';
|
|
21
|
+
import { parseISO, isBefore, startOfDay, isAfter, endOfDay, format } from 'date-fns';
|
|
22
22
|
import { DayPicker } from 'react-day-picker';
|
|
23
23
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
24
|
+
import { Toaster as Toaster$1, toast as toast$1 } from 'sonner';
|
|
24
25
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
25
26
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
26
27
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
27
28
|
import { useTheme } from 'next-themes';
|
|
28
|
-
import { Toaster as Toaster$1, toast as toast$1 } from 'sonner';
|
|
29
29
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
30
30
|
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
31
31
|
|
|
@@ -524,8 +524,8 @@ var reducer = (state, action) => {
|
|
|
524
524
|
if (toastId) {
|
|
525
525
|
addToRemoveQueue(toastId);
|
|
526
526
|
} else {
|
|
527
|
-
state.toasts.forEach((
|
|
528
|
-
addToRemoveQueue(
|
|
527
|
+
state.toasts.forEach((toast5) => {
|
|
528
|
+
addToRemoveQueue(toast5.id);
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
531
|
return {
|
|
@@ -3556,24 +3556,26 @@ var BusinessProfileCard = ({
|
|
|
3556
3556
|
}
|
|
3557
3557
|
)
|
|
3558
3558
|
] }),
|
|
3559
|
-
/* @__PURE__ */
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3559
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
3560
|
+
/* @__PURE__ */ jsx(
|
|
3561
|
+
FormInput,
|
|
3562
|
+
{
|
|
3563
|
+
name: "achCompanyId",
|
|
3564
|
+
label: "ACH Company ID",
|
|
3565
|
+
placeholder: "10-digit company ID"
|
|
3566
|
+
}
|
|
3567
|
+
),
|
|
3568
|
+
/* @__PURE__ */ jsx(
|
|
3569
|
+
FormInput,
|
|
3570
|
+
{
|
|
3571
|
+
name: "productId",
|
|
3572
|
+
label: "Product ID",
|
|
3573
|
+
type: "number",
|
|
3574
|
+
placeholder: "Product ID",
|
|
3575
|
+
disabled: true
|
|
3576
|
+
}
|
|
3577
|
+
)
|
|
3578
|
+
] }),
|
|
3577
3579
|
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
|
|
3578
3580
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
3579
3581
|
/* @__PURE__ */ jsx(
|
|
@@ -3632,6 +3634,34 @@ var BusinessProfileCard = ({
|
|
|
3632
3634
|
/* @__PURE__ */ jsx(InfoField, { label: "Website", value: formValues?.website || "-", layout: "horizontal" })
|
|
3633
3635
|
] }),
|
|
3634
3636
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "Business Phone", value: formValues?.mobilePhone || "-", layout: "horizontal" }) }),
|
|
3637
|
+
/* @__PURE__ */ jsx(
|
|
3638
|
+
InfoField,
|
|
3639
|
+
{
|
|
3640
|
+
label: "Address",
|
|
3641
|
+
value: formValues?.address ? (() => {
|
|
3642
|
+
const parts = [];
|
|
3643
|
+
if (formValues.address.line1) parts.push(formValues.address.line1);
|
|
3644
|
+
if (formValues.address.line2) parts.push(formValues.address.line2);
|
|
3645
|
+
const cityStateZip = [
|
|
3646
|
+
formValues.address.city,
|
|
3647
|
+
formValues.address.state,
|
|
3648
|
+
formValues.address.postalCode
|
|
3649
|
+
].filter(Boolean).join(" ");
|
|
3650
|
+
if (cityStateZip) parts.push(cityStateZip);
|
|
3651
|
+
if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
|
|
3652
|
+
return parts.length > 0 ? parts.join(", ") : "-";
|
|
3653
|
+
})() : "-",
|
|
3654
|
+
layout: "horizontal"
|
|
3655
|
+
}
|
|
3656
|
+
),
|
|
3657
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3658
|
+
/* @__PURE__ */ jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
|
|
3659
|
+
/* @__PURE__ */ jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
|
|
3660
|
+
] }),
|
|
3661
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3662
|
+
/* @__PURE__ */ jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }),
|
|
3663
|
+
/* @__PURE__ */ jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" })
|
|
3664
|
+
] }),
|
|
3635
3665
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3636
3666
|
/* @__PURE__ */ jsx(
|
|
3637
3667
|
InfoField,
|
|
@@ -3657,32 +3687,6 @@ var BusinessProfileCard = ({
|
|
|
3657
3687
|
}
|
|
3658
3688
|
)
|
|
3659
3689
|
] }),
|
|
3660
|
-
/* @__PURE__ */ jsx(
|
|
3661
|
-
InfoField,
|
|
3662
|
-
{
|
|
3663
|
-
label: "Address",
|
|
3664
|
-
value: formValues?.address ? (() => {
|
|
3665
|
-
const parts = [];
|
|
3666
|
-
if (formValues.address.line1) parts.push(formValues.address.line1);
|
|
3667
|
-
if (formValues.address.line2) parts.push(formValues.address.line2);
|
|
3668
|
-
const cityStateZip = [
|
|
3669
|
-
formValues.address.city,
|
|
3670
|
-
formValues.address.state,
|
|
3671
|
-
formValues.address.postalCode
|
|
3672
|
-
].filter(Boolean).join(" ");
|
|
3673
|
-
if (cityStateZip) parts.push(cityStateZip);
|
|
3674
|
-
if (formValues.address.countryCode) parts.push(formValues.address.countryCode);
|
|
3675
|
-
return parts.length > 0 ? parts.join(", ") : "-";
|
|
3676
|
-
})() : "-",
|
|
3677
|
-
layout: "horizontal"
|
|
3678
|
-
}
|
|
3679
|
-
),
|
|
3680
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3681
|
-
/* @__PURE__ */ jsx(InfoField, { label: "MCC", value: formValues?.mcc || "-", layout: "horizontal" }),
|
|
3682
|
-
/* @__PURE__ */ jsx(InfoField, { label: "NAICS", value: formValues?.naics || "-", layout: "horizontal" })
|
|
3683
|
-
] }),
|
|
3684
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "ACH Company ID", value: formValues?.achCompanyId || "-", layout: "horizontal" }) }),
|
|
3685
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsx(InfoField, { label: "Product ID", value: formValues?.productId?.toString() || "-", layout: "horizontal" }) }),
|
|
3686
3690
|
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
|
|
3687
3691
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
3688
3692
|
/* @__PURE__ */ jsx(InfoField, { label: "First Name", value: formValues?.contactPersonFirstName || "-", layout: "horizontal" }),
|
|
@@ -4256,93 +4260,575 @@ var PageLayout = React15.forwardRef(
|
|
|
4256
4260
|
}
|
|
4257
4261
|
);
|
|
4258
4262
|
PageLayout.displayName = "PageLayout";
|
|
4259
|
-
var
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
sortable: true,
|
|
4265
|
-
width: "40%",
|
|
4266
|
-
render: (value, row) => /* @__PURE__ */ jsx(
|
|
4267
|
-
"button",
|
|
4268
|
-
{
|
|
4269
|
-
onClick: () => onUBOClick(row.customerId),
|
|
4270
|
-
className: "text-primary hover:underline font-medium text-left",
|
|
4271
|
-
children: value
|
|
4272
|
-
}
|
|
4273
|
-
)
|
|
4274
|
-
},
|
|
4275
|
-
{
|
|
4276
|
-
key: "title",
|
|
4277
|
-
title: "Title",
|
|
4278
|
-
sortable: true,
|
|
4279
|
-
width: "40%"
|
|
4280
|
-
},
|
|
4281
|
-
{
|
|
4282
|
-
key: "ownershipPercentage",
|
|
4283
|
-
title: "Ownership %",
|
|
4284
|
-
sortable: true,
|
|
4285
|
-
width: "20%",
|
|
4286
|
-
align: "right",
|
|
4287
|
-
render: (value) => `${value}%`
|
|
4288
|
-
}
|
|
4289
|
-
];
|
|
4290
|
-
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
4291
|
-
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
4292
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
|
|
4293
|
-
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
|
|
4294
|
-
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
|
|
4295
|
-
"Add UBO"
|
|
4296
|
-
] })
|
|
4297
|
-
] }),
|
|
4298
|
-
/* @__PURE__ */ jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
4299
|
-
/* @__PURE__ */ jsx(Users, { className: "h-5 w-5 opacity-50" }),
|
|
4300
|
-
/* @__PURE__ */ jsx("p", { children: "No UBOs recorded" })
|
|
4301
|
-
] }) : /* @__PURE__ */ jsx(
|
|
4302
|
-
DataTable,
|
|
4263
|
+
var FormField = React15.forwardRef(
|
|
4264
|
+
({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
|
|
4265
|
+
const isHorizontal = layout === "horizontal";
|
|
4266
|
+
return /* @__PURE__ */ jsxs(
|
|
4267
|
+
"div",
|
|
4303
4268
|
{
|
|
4304
|
-
|
|
4305
|
-
|
|
4269
|
+
ref,
|
|
4270
|
+
className: cn(
|
|
4271
|
+
"space-y-2",
|
|
4272
|
+
isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
|
|
4273
|
+
className
|
|
4274
|
+
),
|
|
4275
|
+
children: [
|
|
4276
|
+
label && /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
|
|
4277
|
+
/* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-foreground", children: [
|
|
4278
|
+
label,
|
|
4279
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
4280
|
+
] }),
|
|
4281
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
|
|
4282
|
+
] }),
|
|
4283
|
+
/* @__PURE__ */ jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
|
|
4284
|
+
children,
|
|
4285
|
+
error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mt-1", children: error })
|
|
4286
|
+
] })
|
|
4287
|
+
]
|
|
4306
4288
|
}
|
|
4307
|
-
)
|
|
4308
|
-
|
|
4289
|
+
);
|
|
4290
|
+
}
|
|
4291
|
+
);
|
|
4292
|
+
FormField.displayName = "FormField";
|
|
4293
|
+
var spacingClasses = {
|
|
4294
|
+
sm: "space-y-3",
|
|
4295
|
+
md: "space-y-4",
|
|
4296
|
+
lg: "space-y-6"
|
|
4309
4297
|
};
|
|
4310
|
-
var
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4298
|
+
var gridClasses = {
|
|
4299
|
+
1: "grid-cols-1",
|
|
4300
|
+
2: "grid-cols-1 md:grid-cols-2",
|
|
4301
|
+
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
4302
|
+
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
4303
|
+
};
|
|
4304
|
+
var FormSection = React15.forwardRef(
|
|
4305
|
+
({
|
|
4306
|
+
title,
|
|
4307
|
+
description,
|
|
4308
|
+
children,
|
|
4309
|
+
className,
|
|
4310
|
+
spacing: spacing2 = "md",
|
|
4311
|
+
layout = "vertical",
|
|
4312
|
+
columns: columns3 = 2
|
|
4313
|
+
}, ref) => {
|
|
4314
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), children: [
|
|
4315
|
+
(title || description) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4316
|
+
title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
4317
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
4318
|
+
] }),
|
|
4319
|
+
/* @__PURE__ */ jsx("div", { className: cn(
|
|
4320
|
+
layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
|
|
4321
|
+
), children })
|
|
4322
|
+
] });
|
|
4323
|
+
}
|
|
4324
|
+
);
|
|
4325
|
+
FormSection.displayName = "FormSection";
|
|
4326
|
+
function Calendar({
|
|
4327
|
+
className,
|
|
4328
|
+
classNames,
|
|
4329
|
+
showOutsideDays = true,
|
|
4330
|
+
...props
|
|
4331
|
+
}) {
|
|
4332
|
+
return /* @__PURE__ */ jsx(
|
|
4333
|
+
DayPicker,
|
|
4334
|
+
{
|
|
4335
|
+
showOutsideDays,
|
|
4336
|
+
className: cn("p-3 pointer-events-auto", className),
|
|
4337
|
+
classNames: {
|
|
4338
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
4339
|
+
month: "space-y-4",
|
|
4340
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
4341
|
+
caption_label: "text-sm font-medium",
|
|
4342
|
+
nav: "space-x-1 flex items-center",
|
|
4343
|
+
button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
4344
|
+
button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
4345
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
4346
|
+
weekdays: "flex",
|
|
4347
|
+
weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
4348
|
+
week: "flex w-full mt-2",
|
|
4349
|
+
day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
4350
|
+
day_button: cn(
|
|
4351
|
+
buttonVariants({ variant: "ghost" }),
|
|
4352
|
+
"h-9 w-9 p-0 font-normal"
|
|
4353
|
+
),
|
|
4354
|
+
selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
|
|
4355
|
+
today: "bg-accent text-accent-foreground",
|
|
4356
|
+
outside: "text-muted-foreground opacity-50",
|
|
4357
|
+
disabled: "text-muted-foreground opacity-50",
|
|
4358
|
+
hidden: "invisible",
|
|
4359
|
+
...classNames
|
|
4360
|
+
},
|
|
4361
|
+
...props
|
|
4331
4362
|
}
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4363
|
+
);
|
|
4364
|
+
}
|
|
4365
|
+
Calendar.displayName = "Calendar";
|
|
4366
|
+
var Popover = PopoverPrimitive.Root;
|
|
4367
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
4368
|
+
var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
4369
|
+
PopoverPrimitive.Content,
|
|
4370
|
+
{
|
|
4371
|
+
ref,
|
|
4372
|
+
align,
|
|
4373
|
+
sideOffset,
|
|
4374
|
+
className: cn(
|
|
4375
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
4376
|
+
className
|
|
4377
|
+
),
|
|
4378
|
+
...props
|
|
4379
|
+
}
|
|
4380
|
+
) }));
|
|
4381
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
4382
|
+
function DatePicker({
|
|
4383
|
+
date,
|
|
4384
|
+
onDateChange,
|
|
4385
|
+
placeholder = "Pick a date",
|
|
4386
|
+
disabled = false,
|
|
4387
|
+
className,
|
|
4388
|
+
buttonClassName,
|
|
4389
|
+
calendarClassName,
|
|
4390
|
+
align = "start",
|
|
4391
|
+
disabledDates,
|
|
4392
|
+
label,
|
|
4393
|
+
wrapperClassName
|
|
4394
|
+
}) {
|
|
4395
|
+
const [open, setOpen] = React15.useState(false);
|
|
4396
|
+
const handleSelect = (selectedDate) => {
|
|
4397
|
+
onDateChange?.(selectedDate);
|
|
4398
|
+
setOpen(false);
|
|
4399
|
+
};
|
|
4400
|
+
const picker = /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
4401
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
4402
|
+
Button,
|
|
4403
|
+
{
|
|
4404
|
+
variant: "outline",
|
|
4405
|
+
disabled,
|
|
4406
|
+
className: cn(
|
|
4407
|
+
"justify-start text-left font-normal",
|
|
4408
|
+
!date && "text-muted-foreground",
|
|
4409
|
+
buttonClassName
|
|
4410
|
+
),
|
|
4411
|
+
children: [
|
|
4412
|
+
/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
4413
|
+
date ? format(date, "MM/dd/yyyy") : placeholder
|
|
4414
|
+
]
|
|
4415
|
+
}
|
|
4416
|
+
) }),
|
|
4417
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsx(
|
|
4418
|
+
Calendar,
|
|
4419
|
+
{
|
|
4420
|
+
mode: "single",
|
|
4421
|
+
selected: date,
|
|
4422
|
+
onSelect: handleSelect,
|
|
4423
|
+
disabled: disabledDates,
|
|
4424
|
+
initialFocus: true,
|
|
4425
|
+
className: cn("pointer-events-auto", calendarClassName)
|
|
4426
|
+
}
|
|
4427
|
+
) })
|
|
4428
|
+
] });
|
|
4429
|
+
if (label) {
|
|
4430
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
|
|
4431
|
+
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
|
|
4432
|
+
picker
|
|
4433
|
+
] });
|
|
4434
|
+
}
|
|
4435
|
+
return picker;
|
|
4436
|
+
}
|
|
4437
|
+
var uboSchema = z.object({
|
|
4438
|
+
legalFirstName: z.string().min(1, "Legal first name is required"),
|
|
4439
|
+
legalLastName: z.string().min(1, "Legal last name is required"),
|
|
4440
|
+
email: z.string().email("Invalid email address"),
|
|
4441
|
+
title: z.string().min(1, "Title is required"),
|
|
4442
|
+
ownershipPercentage: z.number().min(0).max(100, "Must be between 0 and 100"),
|
|
4443
|
+
idNumber: z.string().min(1, "ID number is required"),
|
|
4444
|
+
ssn: z.string().min(1, "SSN is required"),
|
|
4445
|
+
dateOfBirth: z.date({
|
|
4446
|
+
message: "Date of birth is required"
|
|
4447
|
+
}),
|
|
4448
|
+
street: z.string().min(1, "Street is required"),
|
|
4449
|
+
apartment: z.string().optional(),
|
|
4450
|
+
city: z.string().min(1, "City is required"),
|
|
4451
|
+
state: z.string().min(1, "State is required"),
|
|
4452
|
+
country: z.string().min(1, "Country is required")
|
|
4453
|
+
});
|
|
4454
|
+
var titleOptions = [
|
|
4455
|
+
{ value: "CEO", label: "CEO" },
|
|
4456
|
+
{ value: "CFO", label: "CFO" },
|
|
4457
|
+
{ value: "CTO", label: "CTO" },
|
|
4458
|
+
{ value: "COO", label: "COO" },
|
|
4459
|
+
{ value: "President", label: "President" },
|
|
4460
|
+
{ value: "Vice President", label: "Vice President" },
|
|
4461
|
+
{ value: "Director", label: "Director" },
|
|
4462
|
+
{ value: "Manager", label: "Manager" },
|
|
4463
|
+
{ value: "Board Member", label: "Board Member" },
|
|
4464
|
+
{ value: "Partner", label: "Partner" },
|
|
4465
|
+
{ value: "Other", label: "Other" }
|
|
4466
|
+
];
|
|
4467
|
+
var AddUBODialog = ({ open, onOpenChange, onSubmit }) => {
|
|
4468
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
4469
|
+
const form = useForm({
|
|
4470
|
+
resolver: zodResolver(uboSchema),
|
|
4471
|
+
defaultValues: {
|
|
4472
|
+
legalFirstName: "",
|
|
4473
|
+
legalLastName: "",
|
|
4474
|
+
email: "",
|
|
4475
|
+
title: "",
|
|
4476
|
+
ownershipPercentage: 0,
|
|
4477
|
+
idNumber: "",
|
|
4478
|
+
ssn: "",
|
|
4479
|
+
street: "",
|
|
4480
|
+
apartment: "",
|
|
4481
|
+
city: "",
|
|
4482
|
+
state: "",
|
|
4483
|
+
country: "US"
|
|
4484
|
+
}
|
|
4485
|
+
});
|
|
4486
|
+
const handleSubmit = async (data) => {
|
|
4487
|
+
setIsSubmitting(true);
|
|
4488
|
+
try {
|
|
4489
|
+
await onSubmit(data);
|
|
4490
|
+
form.reset();
|
|
4491
|
+
onOpenChange(false);
|
|
4492
|
+
} catch (error) {
|
|
4493
|
+
console.error("Error adding UBO:", error);
|
|
4494
|
+
} finally {
|
|
4495
|
+
setIsSubmitting(false);
|
|
4496
|
+
}
|
|
4497
|
+
};
|
|
4498
|
+
const handleCancel = () => {
|
|
4499
|
+
form.reset();
|
|
4500
|
+
onOpenChange(false);
|
|
4501
|
+
};
|
|
4502
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-3xl max-h-[90vh] overflow-y-auto", children: [
|
|
4503
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Add Ultimate Beneficial Owner" }) }),
|
|
4504
|
+
/* @__PURE__ */ jsx(FormProvider$1, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-6", children: [
|
|
4505
|
+
/* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
|
|
4506
|
+
/* @__PURE__ */ jsx(
|
|
4507
|
+
FormInput,
|
|
4508
|
+
{
|
|
4509
|
+
name: "legalFirstName",
|
|
4510
|
+
label: "Legal first name",
|
|
4511
|
+
placeholder: "Enter first name"
|
|
4512
|
+
}
|
|
4513
|
+
),
|
|
4514
|
+
/* @__PURE__ */ jsx(
|
|
4515
|
+
FormInput,
|
|
4516
|
+
{
|
|
4517
|
+
name: "legalLastName",
|
|
4518
|
+
label: "Legal last name",
|
|
4519
|
+
placeholder: "Enter last name"
|
|
4520
|
+
}
|
|
4521
|
+
)
|
|
4522
|
+
] }),
|
|
4523
|
+
/* @__PURE__ */ jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsx(
|
|
4524
|
+
FormInput,
|
|
4525
|
+
{
|
|
4526
|
+
name: "email",
|
|
4527
|
+
label: "Email",
|
|
4528
|
+
type: "email",
|
|
4529
|
+
placeholder: "Enter email address"
|
|
4530
|
+
}
|
|
4531
|
+
) }),
|
|
4532
|
+
/* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
|
|
4533
|
+
/* @__PURE__ */ jsx(
|
|
4534
|
+
FormSelect,
|
|
4535
|
+
{
|
|
4536
|
+
name: "title",
|
|
4537
|
+
label: "Title",
|
|
4538
|
+
placeholder: "Select title",
|
|
4539
|
+
options: titleOptions
|
|
4540
|
+
}
|
|
4541
|
+
),
|
|
4542
|
+
/* @__PURE__ */ jsx(
|
|
4543
|
+
FormInput,
|
|
4544
|
+
{
|
|
4545
|
+
name: "ownershipPercentage",
|
|
4546
|
+
label: "Ownership %",
|
|
4547
|
+
type: "number",
|
|
4548
|
+
placeholder: "Enter ownership percentage"
|
|
4549
|
+
}
|
|
4550
|
+
)
|
|
4551
|
+
] }),
|
|
4552
|
+
/* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
|
|
4553
|
+
/* @__PURE__ */ jsx(
|
|
4554
|
+
FormInput,
|
|
4555
|
+
{
|
|
4556
|
+
name: "idNumber",
|
|
4557
|
+
label: "ID Number",
|
|
4558
|
+
placeholder: "Enter ID number"
|
|
4559
|
+
}
|
|
4560
|
+
),
|
|
4561
|
+
/* @__PURE__ */ jsx(
|
|
4562
|
+
FormInput,
|
|
4563
|
+
{
|
|
4564
|
+
name: "ssn",
|
|
4565
|
+
label: "SSN",
|
|
4566
|
+
placeholder: "Enter SSN"
|
|
4567
|
+
}
|
|
4568
|
+
)
|
|
4569
|
+
] }),
|
|
4570
|
+
/* @__PURE__ */ jsx(FormSection, { layout: "vertical", spacing: "md", children: /* @__PURE__ */ jsx(FormField, { label: "Date of birth", children: /* @__PURE__ */ jsx(
|
|
4571
|
+
Controller,
|
|
4572
|
+
{
|
|
4573
|
+
name: "dateOfBirth",
|
|
4574
|
+
control: form.control,
|
|
4575
|
+
render: ({ field }) => /* @__PURE__ */ jsx(
|
|
4576
|
+
DatePicker,
|
|
4577
|
+
{
|
|
4578
|
+
date: field.value,
|
|
4579
|
+
onDateChange: field.onChange,
|
|
4580
|
+
placeholder: "MM/DD/YYYY"
|
|
4581
|
+
}
|
|
4582
|
+
)
|
|
4583
|
+
}
|
|
4584
|
+
) }) }),
|
|
4585
|
+
/* @__PURE__ */ jsxs(FormSection, { title: "Address Details", layout: "vertical", spacing: "md", children: [
|
|
4586
|
+
/* @__PURE__ */ jsx(
|
|
4587
|
+
FormInput,
|
|
4588
|
+
{
|
|
4589
|
+
name: "street",
|
|
4590
|
+
label: "Street",
|
|
4591
|
+
placeholder: "Enter street address"
|
|
4592
|
+
}
|
|
4593
|
+
),
|
|
4594
|
+
/* @__PURE__ */ jsx(
|
|
4595
|
+
FormInput,
|
|
4596
|
+
{
|
|
4597
|
+
name: "apartment",
|
|
4598
|
+
label: "Apartment, suite, or floor",
|
|
4599
|
+
placeholder: "Enter apartment, suite, or floor (optional)"
|
|
4600
|
+
}
|
|
4601
|
+
),
|
|
4602
|
+
/* @__PURE__ */ jsxs(FormSection, { layout: "grid", columns: 2, spacing: "md", children: [
|
|
4603
|
+
/* @__PURE__ */ jsx(
|
|
4604
|
+
FormInput,
|
|
4605
|
+
{
|
|
4606
|
+
name: "city",
|
|
4607
|
+
label: "City",
|
|
4608
|
+
placeholder: "Enter city"
|
|
4609
|
+
}
|
|
4610
|
+
),
|
|
4611
|
+
/* @__PURE__ */ jsx(
|
|
4612
|
+
FormInput,
|
|
4613
|
+
{
|
|
4614
|
+
name: "state",
|
|
4615
|
+
label: "State",
|
|
4616
|
+
placeholder: "Enter state"
|
|
4617
|
+
}
|
|
4618
|
+
)
|
|
4619
|
+
] }),
|
|
4620
|
+
/* @__PURE__ */ jsx(
|
|
4621
|
+
FormInput,
|
|
4622
|
+
{
|
|
4623
|
+
name: "country",
|
|
4624
|
+
label: "Country",
|
|
4625
|
+
placeholder: "Enter country"
|
|
4626
|
+
}
|
|
4627
|
+
)
|
|
4628
|
+
] }),
|
|
4629
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
4630
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: handleCancel, children: "Cancel" }),
|
|
4631
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? "Adding..." : "Add UBO" })
|
|
4632
|
+
] })
|
|
4633
|
+
] }) })
|
|
4634
|
+
] }) });
|
|
4635
|
+
};
|
|
4636
|
+
var UBOCard = ({ ubos, onUBOClick }) => {
|
|
4637
|
+
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
4638
|
+
const handleAddUBO = (data) => {
|
|
4639
|
+
console.log("New UBO data:", data);
|
|
4640
|
+
toast$1.success("UBO added successfully");
|
|
4641
|
+
};
|
|
4642
|
+
const columns3 = [
|
|
4643
|
+
{
|
|
4644
|
+
key: "name",
|
|
4645
|
+
title: "Name",
|
|
4646
|
+
sortable: true,
|
|
4647
|
+
width: "40%",
|
|
4648
|
+
render: (value, row) => /* @__PURE__ */ jsx(
|
|
4649
|
+
"button",
|
|
4650
|
+
{
|
|
4651
|
+
onClick: () => onUBOClick(row.customerId),
|
|
4652
|
+
className: "text-primary hover:underline font-medium text-left",
|
|
4653
|
+
children: value
|
|
4654
|
+
}
|
|
4655
|
+
)
|
|
4656
|
+
},
|
|
4657
|
+
{
|
|
4658
|
+
key: "title",
|
|
4659
|
+
title: "Title",
|
|
4660
|
+
sortable: true,
|
|
4661
|
+
width: "40%"
|
|
4662
|
+
},
|
|
4663
|
+
{
|
|
4664
|
+
key: "ownershipPercentage",
|
|
4665
|
+
title: "Ownership %",
|
|
4666
|
+
sortable: true,
|
|
4667
|
+
width: "20%",
|
|
4668
|
+
align: "right",
|
|
4669
|
+
render: (value) => `${value}%`
|
|
4670
|
+
}
|
|
4671
|
+
];
|
|
4672
|
+
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
4673
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
4674
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "Ultimate Beneficial Owners (UBO)" }),
|
|
4675
|
+
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setIsDialogOpen(true), children: [
|
|
4676
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
|
|
4677
|
+
"Add UBO"
|
|
4678
|
+
] })
|
|
4679
|
+
] }),
|
|
4680
|
+
/* @__PURE__ */ jsx(CardContent, { children: ubos.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
4681
|
+
/* @__PURE__ */ jsx(Users, { className: "h-5 w-5 opacity-50" }),
|
|
4682
|
+
/* @__PURE__ */ jsx("p", { children: "No UBOs recorded" })
|
|
4683
|
+
] }) : /* @__PURE__ */ jsx(
|
|
4684
|
+
DataTable,
|
|
4685
|
+
{
|
|
4686
|
+
columns: columns3,
|
|
4687
|
+
data: ubos
|
|
4688
|
+
}
|
|
4689
|
+
) }),
|
|
4690
|
+
/* @__PURE__ */ jsx(
|
|
4691
|
+
AddUBODialog,
|
|
4692
|
+
{
|
|
4693
|
+
open: isDialogOpen,
|
|
4694
|
+
onOpenChange: setIsDialogOpen,
|
|
4695
|
+
onSubmit: handleAddUBO
|
|
4696
|
+
}
|
|
4697
|
+
)
|
|
4698
|
+
] });
|
|
4699
|
+
};
|
|
4700
|
+
var accountSchema = z.object({
|
|
4701
|
+
accountName: z.string().min(1, "Account name is required"),
|
|
4702
|
+
accountType: z.string().min(1, "Account type is required"),
|
|
4703
|
+
fundingFromAccount: z.string().optional(),
|
|
4704
|
+
sweepToAccount: z.string().optional()
|
|
4705
|
+
});
|
|
4706
|
+
var AddAccountDialog = ({
|
|
4707
|
+
open,
|
|
4708
|
+
onOpenChange,
|
|
4709
|
+
onSubmit,
|
|
4710
|
+
existingAccounts = []
|
|
4711
|
+
}) => {
|
|
4712
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
4713
|
+
const form = useForm({
|
|
4714
|
+
resolver: zodResolver(accountSchema),
|
|
4715
|
+
defaultValues: {
|
|
4716
|
+
accountName: "",
|
|
4717
|
+
accountType: void 0,
|
|
4718
|
+
fundingFromAccount: "",
|
|
4719
|
+
sweepToAccount: ""
|
|
4720
|
+
}
|
|
4721
|
+
});
|
|
4722
|
+
const handleSubmit = async (data) => {
|
|
4723
|
+
setIsLoading(true);
|
|
4724
|
+
try {
|
|
4725
|
+
await onSubmit?.(data);
|
|
4726
|
+
form.reset();
|
|
4727
|
+
onOpenChange(false);
|
|
4728
|
+
} catch (error) {
|
|
4729
|
+
console.error("Error creating account:", error);
|
|
4730
|
+
} finally {
|
|
4731
|
+
setIsLoading(false);
|
|
4732
|
+
}
|
|
4733
|
+
};
|
|
4734
|
+
existingAccounts.map((acc) => ({
|
|
4735
|
+
value: acc.id,
|
|
4736
|
+
label: `${acc.number}${acc.type ? ` (${acc.type})` : ""}`
|
|
4737
|
+
}));
|
|
4738
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[600px] max-h-[90vh] overflow-y-auto", children: [
|
|
4739
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Add Account" }) }),
|
|
4740
|
+
/* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(handleSubmit), className: "space-y-4", children: [
|
|
4741
|
+
/* @__PURE__ */ jsxs(FormSection, { spacing: "md", children: [
|
|
4742
|
+
/* @__PURE__ */ jsx(
|
|
4743
|
+
FormInput,
|
|
4744
|
+
{
|
|
4745
|
+
name: "accountName",
|
|
4746
|
+
label: "Account Name",
|
|
4747
|
+
placeholder: "Enter account name",
|
|
4748
|
+
required: true
|
|
4749
|
+
}
|
|
4750
|
+
),
|
|
4751
|
+
/* @__PURE__ */ jsx(
|
|
4752
|
+
FormSelect,
|
|
4753
|
+
{
|
|
4754
|
+
name: "accountType",
|
|
4755
|
+
label: "Account Type",
|
|
4756
|
+
placeholder: "Select account type",
|
|
4757
|
+
options: [
|
|
4758
|
+
{ value: "CHECKING", label: "Checking" },
|
|
4759
|
+
{ value: "SAVINGS", label: "Savings" }
|
|
4760
|
+
]
|
|
4761
|
+
}
|
|
4762
|
+
),
|
|
4763
|
+
/* @__PURE__ */ jsx(
|
|
4764
|
+
FormInput,
|
|
4765
|
+
{
|
|
4766
|
+
name: "fundingFromAccount",
|
|
4767
|
+
label: "Funding from Account",
|
|
4768
|
+
placeholder: "Enter funding account"
|
|
4769
|
+
}
|
|
4770
|
+
),
|
|
4771
|
+
/* @__PURE__ */ jsx(
|
|
4772
|
+
FormInput,
|
|
4773
|
+
{
|
|
4774
|
+
name: "sweepToAccount",
|
|
4775
|
+
label: "Sweep to Account",
|
|
4776
|
+
placeholder: "Enter sweep account"
|
|
4777
|
+
}
|
|
4778
|
+
)
|
|
4779
|
+
] }),
|
|
4780
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
4781
|
+
/* @__PURE__ */ jsx(
|
|
4782
|
+
Button,
|
|
4783
|
+
{
|
|
4784
|
+
type: "button",
|
|
4785
|
+
variant: "outline",
|
|
4786
|
+
onClick: () => onOpenChange(false),
|
|
4787
|
+
disabled: isLoading,
|
|
4788
|
+
children: "Cancel"
|
|
4789
|
+
}
|
|
4790
|
+
),
|
|
4791
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", disabled: isLoading, children: isLoading ? "Creating..." : "Create Account" })
|
|
4792
|
+
] })
|
|
4793
|
+
] }) })
|
|
4794
|
+
] }) });
|
|
4795
|
+
};
|
|
4796
|
+
var BusinessDocuments = ({ businessId, documents, onDocumentUpload }) => {
|
|
4797
|
+
const [isUploading, setIsUploading] = useState(false);
|
|
4798
|
+
const [showUploadDialog, setShowUploadDialog] = useState(false);
|
|
4799
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
4800
|
+
const [documentName, setDocumentName] = useState("");
|
|
4801
|
+
const [description, setDescription] = useState("");
|
|
4802
|
+
const [documentType, setDocumentType] = useState("");
|
|
4803
|
+
const handleFileSelect = (e) => {
|
|
4804
|
+
const file = e.target.files?.[0];
|
|
4805
|
+
if (!file) return;
|
|
4806
|
+
setSelectedFile(file);
|
|
4807
|
+
setDocumentName(file.name);
|
|
4808
|
+
};
|
|
4809
|
+
const handleUploadSubmit = async () => {
|
|
4810
|
+
if (!selectedFile || !documentName || !documentType) {
|
|
4811
|
+
toast({
|
|
4812
|
+
title: "Missing Information",
|
|
4813
|
+
description: "Please fill in all required fields",
|
|
4814
|
+
variant: "destructive"
|
|
4815
|
+
});
|
|
4816
|
+
return;
|
|
4817
|
+
}
|
|
4818
|
+
setIsUploading(true);
|
|
4819
|
+
try {
|
|
4820
|
+
await onDocumentUpload(selectedFile, {
|
|
4821
|
+
name: documentName,
|
|
4822
|
+
description,
|
|
4823
|
+
type: documentType
|
|
4824
|
+
});
|
|
4825
|
+
toast({
|
|
4826
|
+
title: "Upload Successful",
|
|
4827
|
+
description: `${documentName} uploaded successfully`
|
|
4828
|
+
});
|
|
4829
|
+
setShowUploadDialog(false);
|
|
4830
|
+
resetForm();
|
|
4831
|
+
} catch (error) {
|
|
4346
4832
|
toast({
|
|
4347
4833
|
title: "Upload Failed",
|
|
4348
4834
|
description: "Failed to upload document. Please try again.",
|
|
@@ -4644,7 +5130,11 @@ var BusinessDetailView = ({
|
|
|
4644
5130
|
onUBOClick,
|
|
4645
5131
|
onDocumentUpload
|
|
4646
5132
|
}) => {
|
|
4647
|
-
|
|
5133
|
+
const [showAddAccountDialog, setShowAddAccountDialog] = useState(false);
|
|
5134
|
+
const handleAddAccount = (data) => {
|
|
5135
|
+
console.log("New account data:", data);
|
|
5136
|
+
};
|
|
5137
|
+
return /* @__PURE__ */ jsxs(
|
|
4648
5138
|
PageLayout,
|
|
4649
5139
|
{
|
|
4650
5140
|
title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -4683,164 +5173,64 @@ var BusinessDetailView = ({
|
|
|
4683
5173
|
}
|
|
4684
5174
|
],
|
|
4685
5175
|
maxWidth: "full",
|
|
4686
|
-
children:
|
|
4687
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-
|
|
4688
|
-
/* @__PURE__ */
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
/* @__PURE__ */ jsxs(
|
|
4701
|
-
/* @__PURE__ */
|
|
4702
|
-
|
|
4703
|
-
/* @__PURE__ */
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
/* @__PURE__ */ jsx(
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
{
|
|
4742
|
-
showOutsideDays,
|
|
4743
|
-
className: cn("p-3 pointer-events-auto", className),
|
|
4744
|
-
classNames: {
|
|
4745
|
-
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
4746
|
-
month: "space-y-4",
|
|
4747
|
-
caption: "flex justify-center pt-1 relative items-center",
|
|
4748
|
-
caption_label: "text-sm font-medium",
|
|
4749
|
-
nav: "space-x-1 flex items-center",
|
|
4750
|
-
button_previous: "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
4751
|
-
button_next: "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
|
|
4752
|
-
month_grid: "w-full border-collapse space-y-1",
|
|
4753
|
-
weekdays: "flex",
|
|
4754
|
-
weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
4755
|
-
week: "flex w-full mt-2",
|
|
4756
|
-
day: "h-9 w-9 text-center text-sm p-0 relative hover:bg-accent hover:text-accent-foreground rounded-md",
|
|
4757
|
-
day_button: cn(
|
|
4758
|
-
buttonVariants({ variant: "ghost" }),
|
|
4759
|
-
"h-9 w-9 p-0 font-normal"
|
|
4760
|
-
),
|
|
4761
|
-
selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground",
|
|
4762
|
-
today: "bg-accent text-accent-foreground",
|
|
4763
|
-
outside: "text-muted-foreground opacity-50",
|
|
4764
|
-
disabled: "text-muted-foreground opacity-50",
|
|
4765
|
-
hidden: "invisible",
|
|
4766
|
-
...classNames
|
|
4767
|
-
},
|
|
4768
|
-
...props
|
|
5176
|
+
children: [
|
|
5177
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
|
|
5178
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
5179
|
+
/* @__PURE__ */ jsx(
|
|
5180
|
+
BusinessProfileCard,
|
|
5181
|
+
{
|
|
5182
|
+
data: businessProfile,
|
|
5183
|
+
identityVerification,
|
|
5184
|
+
isEditing: isEditingProfile,
|
|
5185
|
+
onToggleEdit: onToggleProfileEdit,
|
|
5186
|
+
onDataChange: onProfileDataChange
|
|
5187
|
+
}
|
|
5188
|
+
),
|
|
5189
|
+
/* @__PURE__ */ jsx(UBOCard, { ubos: businessUBOs, onUBOClick }),
|
|
5190
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
5191
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
5192
|
+
/* @__PURE__ */ jsx(CardTitle, { children: "External Accounts" }),
|
|
5193
|
+
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", onClick: () => setShowAddAccountDialog(true), children: [
|
|
5194
|
+
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
|
|
5195
|
+
"Account"
|
|
5196
|
+
] })
|
|
5197
|
+
] }),
|
|
5198
|
+
/* @__PURE__ */ jsx(CardContent, { children: businessAccounts.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
5199
|
+
/* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
|
|
5200
|
+
/* @__PURE__ */ jsx("p", { children: "No external accounts found" })
|
|
5201
|
+
] }) : /* @__PURE__ */ jsx(
|
|
5202
|
+
DataTable,
|
|
5203
|
+
{
|
|
5204
|
+
columns: accountColumns,
|
|
5205
|
+
data: businessAccounts
|
|
5206
|
+
}
|
|
5207
|
+
) })
|
|
5208
|
+
] }),
|
|
5209
|
+
/* @__PURE__ */ jsx(
|
|
5210
|
+
BusinessDocuments,
|
|
5211
|
+
{
|
|
5212
|
+
businessId: business.id,
|
|
5213
|
+
documents: businessDocuments,
|
|
5214
|
+
onDocumentUpload
|
|
5215
|
+
}
|
|
5216
|
+
)
|
|
5217
|
+
] }),
|
|
5218
|
+
/* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
|
|
5219
|
+
} }) })
|
|
5220
|
+
] }),
|
|
5221
|
+
/* @__PURE__ */ jsx(
|
|
5222
|
+
AddAccountDialog,
|
|
5223
|
+
{
|
|
5224
|
+
open: showAddAccountDialog,
|
|
5225
|
+
onOpenChange: setShowAddAccountDialog,
|
|
5226
|
+
onSubmit: handleAddAccount,
|
|
5227
|
+
existingAccounts: businessAccounts
|
|
5228
|
+
}
|
|
5229
|
+
)
|
|
5230
|
+
]
|
|
4769
5231
|
}
|
|
4770
5232
|
);
|
|
4771
|
-
}
|
|
4772
|
-
Calendar.displayName = "Calendar";
|
|
4773
|
-
var Popover = PopoverPrimitive.Root;
|
|
4774
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
4775
|
-
var PopoverContent = React15.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
4776
|
-
PopoverPrimitive.Content,
|
|
4777
|
-
{
|
|
4778
|
-
ref,
|
|
4779
|
-
align,
|
|
4780
|
-
sideOffset,
|
|
4781
|
-
className: cn(
|
|
4782
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
4783
|
-
className
|
|
4784
|
-
),
|
|
4785
|
-
...props
|
|
4786
|
-
}
|
|
4787
|
-
) }));
|
|
4788
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
4789
|
-
function DatePicker({
|
|
4790
|
-
date,
|
|
4791
|
-
onDateChange,
|
|
4792
|
-
placeholder = "Pick a date",
|
|
4793
|
-
disabled = false,
|
|
4794
|
-
className,
|
|
4795
|
-
buttonClassName,
|
|
4796
|
-
calendarClassName,
|
|
4797
|
-
align = "start",
|
|
4798
|
-
disabledDates,
|
|
4799
|
-
label,
|
|
4800
|
-
wrapperClassName
|
|
4801
|
-
}) {
|
|
4802
|
-
const [open, setOpen] = React15.useState(false);
|
|
4803
|
-
const handleSelect = (selectedDate) => {
|
|
4804
|
-
onDateChange?.(selectedDate);
|
|
4805
|
-
setOpen(false);
|
|
4806
|
-
};
|
|
4807
|
-
const picker = /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
4808
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
4809
|
-
Button,
|
|
4810
|
-
{
|
|
4811
|
-
variant: "outline",
|
|
4812
|
-
disabled,
|
|
4813
|
-
className: cn(
|
|
4814
|
-
"justify-start text-left font-normal",
|
|
4815
|
-
!date && "text-muted-foreground",
|
|
4816
|
-
buttonClassName
|
|
4817
|
-
),
|
|
4818
|
-
children: [
|
|
4819
|
-
/* @__PURE__ */ jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
4820
|
-
date ? format(date, "MM/dd/yyyy") : placeholder
|
|
4821
|
-
]
|
|
4822
|
-
}
|
|
4823
|
-
) }),
|
|
4824
|
-
/* @__PURE__ */ jsx(PopoverContent, { className: cn("w-auto p-0", className), align, children: /* @__PURE__ */ jsx(
|
|
4825
|
-
Calendar,
|
|
4826
|
-
{
|
|
4827
|
-
mode: "single",
|
|
4828
|
-
selected: date,
|
|
4829
|
-
onSelect: handleSelect,
|
|
4830
|
-
disabled: disabledDates,
|
|
4831
|
-
initialFocus: true,
|
|
4832
|
-
className: cn("pointer-events-auto", calendarClassName)
|
|
4833
|
-
}
|
|
4834
|
-
) })
|
|
4835
|
-
] });
|
|
4836
|
-
if (label) {
|
|
4837
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", wrapperClassName), children: [
|
|
4838
|
-
/* @__PURE__ */ jsx("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: label }),
|
|
4839
|
-
picker
|
|
4840
|
-
] });
|
|
4841
|
-
}
|
|
4842
|
-
return picker;
|
|
4843
|
-
}
|
|
5233
|
+
};
|
|
4844
5234
|
var BusinessFiltersSheet = ({
|
|
4845
5235
|
filters,
|
|
4846
5236
|
onFilterChange,
|
|
@@ -6457,39 +6847,6 @@ var CounterpartyBasicInfo = ({ onDataChange }) => {
|
|
|
6457
6847
|
] })
|
|
6458
6848
|
] });
|
|
6459
6849
|
};
|
|
6460
|
-
var spacingClasses = {
|
|
6461
|
-
sm: "space-y-3",
|
|
6462
|
-
md: "space-y-4",
|
|
6463
|
-
lg: "space-y-6"
|
|
6464
|
-
};
|
|
6465
|
-
var gridClasses = {
|
|
6466
|
-
1: "grid-cols-1",
|
|
6467
|
-
2: "grid-cols-1 md:grid-cols-2",
|
|
6468
|
-
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
|
|
6469
|
-
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
|
|
6470
|
-
};
|
|
6471
|
-
var FormSection = React15.forwardRef(
|
|
6472
|
-
({
|
|
6473
|
-
title,
|
|
6474
|
-
description,
|
|
6475
|
-
children,
|
|
6476
|
-
className,
|
|
6477
|
-
spacing: spacing2 = "md",
|
|
6478
|
-
layout = "vertical",
|
|
6479
|
-
columns: columns3 = 2
|
|
6480
|
-
}, ref) => {
|
|
6481
|
-
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), children: [
|
|
6482
|
-
(title || description) && /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
6483
|
-
title && /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
6484
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
|
|
6485
|
-
] }),
|
|
6486
|
-
/* @__PURE__ */ jsx("div", { className: cn(
|
|
6487
|
-
layout === "grid" ? `grid gap-4 ${gridClasses[columns3]}` : spacingClasses[spacing2]
|
|
6488
|
-
), children })
|
|
6489
|
-
] });
|
|
6490
|
-
}
|
|
6491
|
-
);
|
|
6492
|
-
FormSection.displayName = "FormSection";
|
|
6493
6850
|
var IntermediaryFI = () => {
|
|
6494
6851
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
6495
6852
|
/* @__PURE__ */ jsxs("div", { className: "border-b border-border pb-4", children: [
|
|
@@ -7956,36 +8313,6 @@ var EntityCard = React15.forwardRef(
|
|
|
7956
8313
|
}
|
|
7957
8314
|
);
|
|
7958
8315
|
EntityCard.displayName = "EntityCard";
|
|
7959
|
-
var FormField = React15.forwardRef(
|
|
7960
|
-
({ label, description, error, required, children, className, layout = "vertical" }, ref) => {
|
|
7961
|
-
const isHorizontal = layout === "horizontal";
|
|
7962
|
-
return /* @__PURE__ */ jsxs(
|
|
7963
|
-
"div",
|
|
7964
|
-
{
|
|
7965
|
-
ref,
|
|
7966
|
-
className: cn(
|
|
7967
|
-
"space-y-2",
|
|
7968
|
-
isHorizontal && "grid grid-cols-1 md:grid-cols-3 gap-4 items-start space-y-0",
|
|
7969
|
-
className
|
|
7970
|
-
),
|
|
7971
|
-
children: [
|
|
7972
|
-
label && /* @__PURE__ */ jsxs("div", { className: cn("space-y-1", isHorizontal && "pt-2"), children: [
|
|
7973
|
-
/* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-foreground", children: [
|
|
7974
|
-
label,
|
|
7975
|
-
required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
|
|
7976
|
-
] }),
|
|
7977
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: description })
|
|
7978
|
-
] }),
|
|
7979
|
-
/* @__PURE__ */ jsxs("div", { className: cn(isHorizontal && "md:col-span-2"), children: [
|
|
7980
|
-
children,
|
|
7981
|
-
error && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive mt-1", children: error })
|
|
7982
|
-
] })
|
|
7983
|
-
]
|
|
7984
|
-
}
|
|
7985
|
-
);
|
|
7986
|
-
}
|
|
7987
|
-
);
|
|
7988
|
-
FormField.displayName = "FormField";
|
|
7989
8316
|
var variantStyles = {
|
|
7990
8317
|
default: "",
|
|
7991
8318
|
success: "border-success/20 bg-success/5",
|
|
@@ -9364,39 +9691,6 @@ var AccountStatusCard = ({ isEditing, onToggleEdit, className }) => {
|
|
|
9364
9691
|
}
|
|
9365
9692
|
);
|
|
9366
9693
|
};
|
|
9367
|
-
var AccountBalanceCard = React15__default.forwardRef(
|
|
9368
|
-
({ balance, availableBalance, accountNumber, accountType, className }, ref) => {
|
|
9369
|
-
return /* @__PURE__ */ jsx(
|
|
9370
|
-
Card,
|
|
9371
|
-
{
|
|
9372
|
-
ref,
|
|
9373
|
-
className: cn(
|
|
9374
|
-
"border-primary/20 bg-gradient-to-br from-primary/5 via-primary/3 to-background",
|
|
9375
|
-
className
|
|
9376
|
-
),
|
|
9377
|
-
children: /* @__PURE__ */ jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
9378
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
9379
|
-
/* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
|
|
9380
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: accountNumber }),
|
|
9381
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
|
|
9382
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: accountType })
|
|
9383
|
-
] }),
|
|
9384
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
|
|
9385
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
9386
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
|
|
9387
|
-
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: balance })
|
|
9388
|
-
] }),
|
|
9389
|
-
availableBalance && /* @__PURE__ */ jsxs("div", { children: [
|
|
9390
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
|
|
9391
|
-
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: availableBalance })
|
|
9392
|
-
] })
|
|
9393
|
-
] })
|
|
9394
|
-
] }) })
|
|
9395
|
-
}
|
|
9396
|
-
);
|
|
9397
|
-
}
|
|
9398
|
-
);
|
|
9399
|
-
AccountBalanceCard.displayName = "AccountBalanceCard";
|
|
9400
9694
|
var accountInfoSchema = z.object({
|
|
9401
9695
|
accountName: z.string().trim().min(1, "Account name is required").max(100, "Account name must be less than 100 characters"),
|
|
9402
9696
|
canAcceptSweep: z.enum(["Yes", "No"]),
|
|
@@ -9426,7 +9720,7 @@ var AccountDetail = () => {
|
|
|
9426
9720
|
}
|
|
9427
9721
|
const formValues = form.watch();
|
|
9428
9722
|
const customerPath = account.customerType === "business" ? `/business/${account.customerId}` : `/individual/${account.customerId}`;
|
|
9429
|
-
return /* @__PURE__ */
|
|
9723
|
+
return /* @__PURE__ */ jsx(
|
|
9430
9724
|
PageLayout,
|
|
9431
9725
|
{
|
|
9432
9726
|
title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -9469,29 +9763,37 @@ var AccountDetail = () => {
|
|
|
9469
9763
|
}
|
|
9470
9764
|
],
|
|
9471
9765
|
maxWidth: "full",
|
|
9472
|
-
children: [
|
|
9473
|
-
/* @__PURE__ */
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9766
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
|
|
9767
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
9768
|
+
/* @__PURE__ */ jsx(
|
|
9769
|
+
EditableFormCard,
|
|
9770
|
+
{
|
|
9771
|
+
title: "Account Information",
|
|
9772
|
+
variant: "subtle",
|
|
9773
|
+
isEditing: form.isEditing,
|
|
9774
|
+
onToggleEdit: form.handleToggleEdit,
|
|
9775
|
+
onSave: form.handleSave,
|
|
9776
|
+
onCancel: form.handleCancel,
|
|
9777
|
+
viewContent: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9778
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
|
|
9779
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
9780
|
+
/* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
|
|
9781
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
|
|
9782
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
|
|
9783
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
|
|
9784
|
+
] }),
|
|
9785
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
|
|
9786
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
9787
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
|
|
9788
|
+
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
|
|
9789
|
+
] }),
|
|
9790
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
9791
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
|
|
9792
|
+
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
|
|
9793
|
+
] })
|
|
9794
|
+
] })
|
|
9795
|
+
] }),
|
|
9796
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
9495
9797
|
/* @__PURE__ */ jsx(
|
|
9496
9798
|
InfoField,
|
|
9497
9799
|
{
|
|
@@ -9555,8 +9857,28 @@ var AccountDetail = () => {
|
|
|
9555
9857
|
value: formValues.sweepAccountNumber || "-"
|
|
9556
9858
|
}
|
|
9557
9859
|
)
|
|
9860
|
+
] })
|
|
9861
|
+
] }),
|
|
9862
|
+
editContent: /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9863
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-6 p-6 rounded-lg bg-gradient-to-br from-primary/10 via-primary/5 to-background border border-primary/20", children: [
|
|
9864
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
9865
|
+
/* @__PURE__ */ jsx(Wallet, { className: "h-4 w-4 text-primary" }),
|
|
9866
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: account.number }),
|
|
9867
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2022" }),
|
|
9868
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground capitalize", children: account.type })
|
|
9869
|
+
] }),
|
|
9870
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end gap-8", children: [
|
|
9871
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
9872
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Account Balance" }),
|
|
9873
|
+
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
|
|
9874
|
+
] }),
|
|
9875
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
9876
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground mb-1", children: "Available Balance" }),
|
|
9877
|
+
/* @__PURE__ */ jsx("p", { className: "text-3xl font-bold text-foreground tracking-tight", children: account.balance })
|
|
9878
|
+
] })
|
|
9879
|
+
] })
|
|
9558
9880
|
] }),
|
|
9559
|
-
|
|
9881
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
9560
9882
|
/* @__PURE__ */ jsx(
|
|
9561
9883
|
InfoField,
|
|
9562
9884
|
{
|
|
@@ -9628,18 +9950,18 @@ var AccountDetail = () => {
|
|
|
9628
9950
|
placeholder: "Enter sweep account number"
|
|
9629
9951
|
}
|
|
9630
9952
|
)
|
|
9631
|
-
] })
|
|
9632
|
-
}
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
] })
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
]
|
|
9953
|
+
] })
|
|
9954
|
+
] }) })
|
|
9955
|
+
}
|
|
9956
|
+
),
|
|
9957
|
+
/* @__PURE__ */ jsxs(Card, { children: [
|
|
9958
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Fees" }) }),
|
|
9959
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "Fees information coming soon" }) }) })
|
|
9960
|
+
] })
|
|
9961
|
+
] }),
|
|
9962
|
+
/* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(AccountStatusCard, { isEditing: false, onToggleEdit: () => {
|
|
9963
|
+
} }) })
|
|
9964
|
+
] })
|
|
9643
9965
|
}
|
|
9644
9966
|
);
|
|
9645
9967
|
};
|
|
@@ -11084,8 +11406,83 @@ var PaymentMethodCard = ({
|
|
|
11084
11406
|
intermediaryBankId && /* @__PURE__ */ jsx(InfoField, { label: "Intermediary Bank ID", value: intermediaryBankId })
|
|
11085
11407
|
] })
|
|
11086
11408
|
] })
|
|
11087
|
-
] })
|
|
11088
|
-
] });
|
|
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
|
+
);
|
|
11089
11486
|
};
|
|
11090
11487
|
var mockPaymentMethods = [
|
|
11091
11488
|
{
|
|
@@ -11145,6 +11542,33 @@ var CounterpartyDetail = () => {
|
|
|
11145
11542
|
render: (value) => /* @__PURE__ */ jsx("span", { className: "capitalize", children: value })
|
|
11146
11543
|
}
|
|
11147
11544
|
];
|
|
11545
|
+
const handleStatusChange = (newStatus) => {
|
|
11546
|
+
setCurrentStatus(newStatus);
|
|
11547
|
+
};
|
|
11548
|
+
const handleToggleProfileEdit = () => {
|
|
11549
|
+
setIsEditingProfile(!isEditingProfile);
|
|
11550
|
+
};
|
|
11551
|
+
const handleAddPaymentMethod = () => {
|
|
11552
|
+
console.log("Add payment method");
|
|
11553
|
+
};
|
|
11554
|
+
const handleAddDocument = () => {
|
|
11555
|
+
console.log("Add document");
|
|
11556
|
+
};
|
|
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]);
|
|
11148
11572
|
if (!counterparty) {
|
|
11149
11573
|
return /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
11150
11574
|
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold mb-2", children: "Counterparty Not Found" }),
|
|
@@ -11152,74 +11576,18 @@ var CounterpartyDetail = () => {
|
|
|
11152
11576
|
] }) });
|
|
11153
11577
|
}
|
|
11154
11578
|
return /* @__PURE__ */ jsx(
|
|
11155
|
-
|
|
11579
|
+
CounterpartyDetailView,
|
|
11156
11580
|
{
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
{ value: "PENDING", label: "Pending" },
|
|
11168
|
-
{ value: "SUSPENDED", label: "Suspended" }
|
|
11169
|
-
],
|
|
11170
|
-
onChange: (newStatus) => setCurrentStatus(newStatus),
|
|
11171
|
-
renderValue: (value) => /* @__PURE__ */ jsx(StatusBadge, { status: value }),
|
|
11172
|
-
className: "inline-block"
|
|
11173
|
-
}
|
|
11174
|
-
),
|
|
11175
|
-
/* @__PURE__ */ jsx(CounterpartyTypeBadge, { type: counterparty.type })
|
|
11176
|
-
] }),
|
|
11177
|
-
maxWidth: "full",
|
|
11178
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-4", children: [
|
|
11179
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
11180
|
-
/* @__PURE__ */ jsx(
|
|
11181
|
-
CounterpartyProfileCard,
|
|
11182
|
-
{
|
|
11183
|
-
isEditing: isEditingProfile,
|
|
11184
|
-
onToggleEdit: () => setIsEditingProfile(!isEditingProfile)
|
|
11185
|
-
}
|
|
11186
|
-
),
|
|
11187
|
-
/* @__PURE__ */ jsxs(Card, { children: [
|
|
11188
|
-
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
11189
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Payment Methods" }),
|
|
11190
|
-
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
|
|
11191
|
-
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
|
|
11192
|
-
"Method"
|
|
11193
|
-
] })
|
|
11194
|
-
] }),
|
|
11195
|
-
/* @__PURE__ */ jsx(CardContent, { children: mockPaymentMethods.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
11196
|
-
/* @__PURE__ */ jsx(Wallet, { className: "h-5 w-5 opacity-50" }),
|
|
11197
|
-
/* @__PURE__ */ jsx("p", { children: "No payment methods configured" })
|
|
11198
|
-
] }) : /* @__PURE__ */ jsx(ResponsiveGrid, { type: "forms", gap: "md", children: mockPaymentMethods.map((method, index) => /* @__PURE__ */ jsx(PaymentMethodCard, { ...method }, index)) }) })
|
|
11199
|
-
] }),
|
|
11200
|
-
/* @__PURE__ */ jsxs(Card, { children: [
|
|
11201
|
-
/* @__PURE__ */ jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
|
|
11202
|
-
/* @__PURE__ */ jsx(CardTitle, { children: "Documents" }),
|
|
11203
|
-
/* @__PURE__ */ jsxs(Button, { size: "sm", variant: "ghost", children: [
|
|
11204
|
-
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4 mr-1" }),
|
|
11205
|
-
"Document"
|
|
11206
|
-
] })
|
|
11207
|
-
] }),
|
|
11208
|
-
/* @__PURE__ */ jsx(CardContent, { children: counterpartyDocuments.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 py-4 text-sm text-muted-foreground", children: [
|
|
11209
|
-
/* @__PURE__ */ jsx(FileText, { className: "h-5 w-5 opacity-50" }),
|
|
11210
|
-
/* @__PURE__ */ jsx("p", { children: "No documents found" })
|
|
11211
|
-
] }) : /* @__PURE__ */ jsx(
|
|
11212
|
-
DataTable,
|
|
11213
|
-
{
|
|
11214
|
-
columns: documentColumns,
|
|
11215
|
-
data: counterpartyDocuments
|
|
11216
|
-
}
|
|
11217
|
-
) })
|
|
11218
|
-
] })
|
|
11219
|
-
] }),
|
|
11220
|
-
/* @__PURE__ */ jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsx(CounterpartyStatusCard, { isEditing: false, onToggleEdit: () => {
|
|
11221
|
-
} }) })
|
|
11222
|
-
] })
|
|
11581
|
+
counterpartyName: counterparty.name,
|
|
11582
|
+
counterpartyType: counterparty.type,
|
|
11583
|
+
currentStatus,
|
|
11584
|
+
isEditingProfile,
|
|
11585
|
+
mockPaymentMethods,
|
|
11586
|
+
documentsTable,
|
|
11587
|
+
onStatusChange: handleStatusChange,
|
|
11588
|
+
onToggleProfileEdit: handleToggleProfileEdit,
|
|
11589
|
+
onAddPaymentMethod: handleAddPaymentMethod,
|
|
11590
|
+
onAddDocument: handleAddDocument
|
|
11223
11591
|
}
|
|
11224
11592
|
);
|
|
11225
11593
|
};
|
|
@@ -13857,7 +14225,7 @@ var TransactionDetail = () => {
|
|
|
13857
14225
|
/* @__PURE__ */ jsx(Button, { onClick: () => navigate("/transactions/history"), children: "Back to Transaction History" })
|
|
13858
14226
|
] }) });
|
|
13859
14227
|
}
|
|
13860
|
-
const
|
|
14228
|
+
const getStatusVariant2 = (status) => {
|
|
13861
14229
|
switch (status) {
|
|
13862
14230
|
case "POSTED":
|
|
13863
14231
|
return "success";
|
|
@@ -13913,7 +14281,7 @@ var TransactionDetail = () => {
|
|
|
13913
14281
|
isInbound: transaction.isInbound
|
|
13914
14282
|
}
|
|
13915
14283
|
),
|
|
13916
|
-
/* @__PURE__ */ jsx(Badge, { variant:
|
|
14284
|
+
/* @__PURE__ */ jsx(Badge, { variant: getStatusVariant2(transaction.status), children: transaction.status }),
|
|
13917
14285
|
/* @__PURE__ */ jsx(Badge, { variant: getProcessingStatusVariant(transaction.processingStatus), children: transaction.processingStatus })
|
|
13918
14286
|
] }),
|
|
13919
14287
|
maxWidth: "full",
|
|
@@ -14012,7 +14380,342 @@ function UIKit() {
|
|
|
14012
14380
|
] })
|
|
14013
14381
|
] }) }) });
|
|
14014
14382
|
}
|
|
14383
|
+
function OFACFiltersSheet({
|
|
14384
|
+
filters,
|
|
14385
|
+
onFilterChange,
|
|
14386
|
+
onResetFilters
|
|
14387
|
+
}) {
|
|
14388
|
+
const hasActiveFilters = filters.status !== "" || filters.entityType !== "" || filters.startDate !== void 0 || filters.endDate !== void 0;
|
|
14389
|
+
return /* @__PURE__ */ jsxs(Sheet, { children: [
|
|
14390
|
+
/* @__PURE__ */ jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "outline", children: [
|
|
14391
|
+
/* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
|
|
14392
|
+
"Filters",
|
|
14393
|
+
hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "ml-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground", children: [filters.status, filters.entityType, filters.startDate, filters.endDate].filter(Boolean).length })
|
|
14394
|
+
] }) }),
|
|
14395
|
+
/* @__PURE__ */ jsxs(SheetContent, { className: "w-full sm:max-w-md overflow-y-auto", children: [
|
|
14396
|
+
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
14397
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
14398
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Filter OFAC Checks" }),
|
|
14399
|
+
hasActiveFilters && /* @__PURE__ */ jsxs(
|
|
14400
|
+
Button,
|
|
14401
|
+
{
|
|
14402
|
+
variant: "ghost",
|
|
14403
|
+
size: "sm",
|
|
14404
|
+
onClick: onResetFilters,
|
|
14405
|
+
className: "h-8 px-2",
|
|
14406
|
+
children: [
|
|
14407
|
+
/* @__PURE__ */ jsx(X, { className: "mr-1 h-4 w-4" }),
|
|
14408
|
+
"Clear all"
|
|
14409
|
+
]
|
|
14410
|
+
}
|
|
14411
|
+
)
|
|
14412
|
+
] }),
|
|
14413
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Filter OFAC screening results by status, entity type, and date range" })
|
|
14414
|
+
] }),
|
|
14415
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6 mt-6", children: [
|
|
14416
|
+
/* @__PURE__ */ jsx(
|
|
14417
|
+
EnhancedSelect,
|
|
14418
|
+
{
|
|
14419
|
+
label: "Status",
|
|
14420
|
+
placeholder: "All statuses",
|
|
14421
|
+
options: [
|
|
14422
|
+
{ value: "all", label: "All statuses" },
|
|
14423
|
+
{ value: "NO MATCH", label: "No Match" },
|
|
14424
|
+
{ value: "REVIEW", label: "Review" },
|
|
14425
|
+
{ value: "CLEARED", label: "Cleared" },
|
|
14426
|
+
{ value: "CONFIRMED", label: "Confirmed" }
|
|
14427
|
+
],
|
|
14428
|
+
value: filters.status || "all",
|
|
14429
|
+
onValueChange: (value) => onFilterChange("status", value === "all" ? "" : value)
|
|
14430
|
+
}
|
|
14431
|
+
),
|
|
14432
|
+
/* @__PURE__ */ jsx(
|
|
14433
|
+
EnhancedSelect,
|
|
14434
|
+
{
|
|
14435
|
+
label: "Entity Type",
|
|
14436
|
+
placeholder: "All entity types",
|
|
14437
|
+
options: [
|
|
14438
|
+
{ value: "all", label: "All entity types" },
|
|
14439
|
+
{ value: "Business", label: "Business" },
|
|
14440
|
+
{ value: "Individual", label: "Individual" },
|
|
14441
|
+
{ value: "Counterparty", label: "Counterparty" }
|
|
14442
|
+
],
|
|
14443
|
+
value: filters.entityType || "all",
|
|
14444
|
+
onValueChange: (value) => onFilterChange("entityType", value === "all" ? "" : value)
|
|
14445
|
+
}
|
|
14446
|
+
),
|
|
14447
|
+
/* @__PURE__ */ jsx(
|
|
14448
|
+
DatePicker,
|
|
14449
|
+
{
|
|
14450
|
+
date: filters.startDate,
|
|
14451
|
+
onDateChange: (date) => onFilterChange("startDate", date),
|
|
14452
|
+
label: "Start Date",
|
|
14453
|
+
placeholder: "MM/DD/YYYY"
|
|
14454
|
+
}
|
|
14455
|
+
),
|
|
14456
|
+
/* @__PURE__ */ jsx(
|
|
14457
|
+
DatePicker,
|
|
14458
|
+
{
|
|
14459
|
+
date: filters.endDate,
|
|
14460
|
+
onDateChange: (date) => onFilterChange("endDate", date),
|
|
14461
|
+
label: "End Date",
|
|
14462
|
+
placeholder: "MM/DD/YYYY",
|
|
14463
|
+
disabledDates: (date) => filters.startDate ? date < filters.startDate : false
|
|
14464
|
+
}
|
|
14465
|
+
)
|
|
14466
|
+
] })
|
|
14467
|
+
] })
|
|
14468
|
+
] });
|
|
14469
|
+
}
|
|
14470
|
+
|
|
14471
|
+
// src/lib/mock-data/ofac-data.ts
|
|
14472
|
+
var mockOFACChecks = [
|
|
14473
|
+
{
|
|
14474
|
+
id: "ofac-001",
|
|
14475
|
+
created: "2024-01-15T10:30:00Z",
|
|
14476
|
+
entityId: "8112488",
|
|
14477
|
+
entityName: "Acme Corporation",
|
|
14478
|
+
entityType: "Business",
|
|
14479
|
+
alertId: "ALT-001",
|
|
14480
|
+
status: "CLEARED"
|
|
14481
|
+
},
|
|
14482
|
+
{
|
|
14483
|
+
id: "ofac-002",
|
|
14484
|
+
created: "2024-01-14T14:22:00Z",
|
|
14485
|
+
entityId: "8111609",
|
|
14486
|
+
entityName: "Global Tech Industries",
|
|
14487
|
+
entityType: "Business",
|
|
14488
|
+
alertId: "ALT-002",
|
|
14489
|
+
status: "REVIEW"
|
|
14490
|
+
},
|
|
14491
|
+
{
|
|
14492
|
+
id: "ofac-003",
|
|
14493
|
+
created: "2024-01-14T09:15:00Z",
|
|
14494
|
+
entityId: "IND-001",
|
|
14495
|
+
entityName: "John Smith",
|
|
14496
|
+
entityType: "Individual",
|
|
14497
|
+
alertId: null,
|
|
14498
|
+
status: "NO MATCH"
|
|
14499
|
+
},
|
|
14500
|
+
{
|
|
14501
|
+
id: "ofac-004",
|
|
14502
|
+
created: "2024-01-13T16:45:00Z",
|
|
14503
|
+
entityId: "8111026",
|
|
14504
|
+
entityName: "Innovation Partners LLC",
|
|
14505
|
+
entityType: "Business",
|
|
14506
|
+
alertId: "ALT-003",
|
|
14507
|
+
status: "CONFIRMED"
|
|
14508
|
+
},
|
|
14509
|
+
{
|
|
14510
|
+
id: "ofac-005",
|
|
14511
|
+
created: "2024-01-13T11:20:00Z",
|
|
14512
|
+
entityId: "IND-002",
|
|
14513
|
+
entityName: "Jane Doe",
|
|
14514
|
+
entityType: "Individual",
|
|
14515
|
+
alertId: null,
|
|
14516
|
+
status: "NO MATCH"
|
|
14517
|
+
},
|
|
14518
|
+
{
|
|
14519
|
+
id: "ofac-006",
|
|
14520
|
+
created: "2024-01-12T13:30:00Z",
|
|
14521
|
+
entityId: "CP-001",
|
|
14522
|
+
entityName: "International Suppliers Inc",
|
|
14523
|
+
entityType: "Counterparty",
|
|
14524
|
+
alertId: "ALT-004",
|
|
14525
|
+
status: "REVIEW"
|
|
14526
|
+
},
|
|
14527
|
+
{
|
|
14528
|
+
id: "ofac-007",
|
|
14529
|
+
created: "2024-01-12T08:00:00Z",
|
|
14530
|
+
entityId: "8110892",
|
|
14531
|
+
entityName: "NextGen Solutions",
|
|
14532
|
+
entityType: "Business",
|
|
14533
|
+
alertId: null,
|
|
14534
|
+
status: "NO MATCH"
|
|
14535
|
+
},
|
|
14536
|
+
{
|
|
14537
|
+
id: "ofac-008",
|
|
14538
|
+
created: "2024-01-11T15:10:00Z",
|
|
14539
|
+
entityId: "IND-003",
|
|
14540
|
+
entityName: "Robert Johnson",
|
|
14541
|
+
entityType: "Individual",
|
|
14542
|
+
alertId: "ALT-005",
|
|
14543
|
+
status: "CLEARED"
|
|
14544
|
+
},
|
|
14545
|
+
{
|
|
14546
|
+
id: "ofac-009",
|
|
14547
|
+
created: "2024-01-11T10:45:00Z",
|
|
14548
|
+
entityId: "CP-002",
|
|
14549
|
+
entityName: "Overseas Trading Company",
|
|
14550
|
+
entityType: "Counterparty",
|
|
14551
|
+
alertId: "ALT-006",
|
|
14552
|
+
status: "REVIEW"
|
|
14553
|
+
},
|
|
14554
|
+
{
|
|
14555
|
+
id: "ofac-010",
|
|
14556
|
+
created: "2024-01-10T14:25:00Z",
|
|
14557
|
+
entityId: "8110654",
|
|
14558
|
+
entityName: "Digital Ventures Group",
|
|
14559
|
+
entityType: "Business",
|
|
14560
|
+
alertId: null,
|
|
14561
|
+
status: "NO MATCH"
|
|
14562
|
+
}
|
|
14563
|
+
];
|
|
14564
|
+
var getStatusVariant = (status) => {
|
|
14565
|
+
switch (status) {
|
|
14566
|
+
case "NO MATCH":
|
|
14567
|
+
return "success";
|
|
14568
|
+
case "REVIEW":
|
|
14569
|
+
return "warning";
|
|
14570
|
+
case "CLEARED":
|
|
14571
|
+
return "active";
|
|
14572
|
+
case "CONFIRMED":
|
|
14573
|
+
return "destructive";
|
|
14574
|
+
default:
|
|
14575
|
+
return "secondary";
|
|
14576
|
+
}
|
|
14577
|
+
};
|
|
14578
|
+
var getEntityUrl = (entityType, entityId) => {
|
|
14579
|
+
switch (entityType) {
|
|
14580
|
+
case "Business":
|
|
14581
|
+
return `/business/${entityId}`;
|
|
14582
|
+
case "Individual":
|
|
14583
|
+
return `/individual/${entityId}`;
|
|
14584
|
+
case "Counterparty":
|
|
14585
|
+
return `/counterparty/${entityId}`;
|
|
14586
|
+
default:
|
|
14587
|
+
return "#";
|
|
14588
|
+
}
|
|
14589
|
+
};
|
|
14590
|
+
function OFAC() {
|
|
14591
|
+
const navigate = useNavigate();
|
|
14592
|
+
const [sortField, setSortField] = useState("created");
|
|
14593
|
+
const [sortDirection, setSortDirection] = useState("desc");
|
|
14594
|
+
const [filters, setFilters] = useState({
|
|
14595
|
+
status: "",
|
|
14596
|
+
entityType: "",
|
|
14597
|
+
startDate: void 0,
|
|
14598
|
+
endDate: void 0
|
|
14599
|
+
});
|
|
14600
|
+
const handleFilterChange = (field, value) => {
|
|
14601
|
+
setFilters((prev) => ({ ...prev, [field]: value }));
|
|
14602
|
+
};
|
|
14603
|
+
const handleResetFilters = () => {
|
|
14604
|
+
setFilters({
|
|
14605
|
+
status: "",
|
|
14606
|
+
entityType: "",
|
|
14607
|
+
startDate: void 0,
|
|
14608
|
+
endDate: void 0
|
|
14609
|
+
});
|
|
14610
|
+
};
|
|
14611
|
+
const handleSort = (field) => {
|
|
14612
|
+
if (sortField === field) {
|
|
14613
|
+
setSortDirection(sortDirection === "asc" ? "desc" : "asc");
|
|
14614
|
+
} else {
|
|
14615
|
+
setSortField(field);
|
|
14616
|
+
setSortDirection("desc");
|
|
14617
|
+
}
|
|
14618
|
+
};
|
|
14619
|
+
const filteredChecks = useMemo(() => {
|
|
14620
|
+
return mockOFACChecks.filter((check) => {
|
|
14621
|
+
if (filters.status && check.status !== filters.status) {
|
|
14622
|
+
return false;
|
|
14623
|
+
}
|
|
14624
|
+
if (filters.entityType && check.entityType !== filters.entityType) {
|
|
14625
|
+
return false;
|
|
14626
|
+
}
|
|
14627
|
+
if (filters.startDate || filters.endDate) {
|
|
14628
|
+
const checkDate = parseISO(check.created);
|
|
14629
|
+
if (filters.startDate && isBefore(checkDate, startOfDay(filters.startDate))) {
|
|
14630
|
+
return false;
|
|
14631
|
+
}
|
|
14632
|
+
if (filters.endDate && isAfter(checkDate, endOfDay(filters.endDate))) {
|
|
14633
|
+
return false;
|
|
14634
|
+
}
|
|
14635
|
+
}
|
|
14636
|
+
return true;
|
|
14637
|
+
});
|
|
14638
|
+
}, [filters]);
|
|
14639
|
+
const sortedChecks = [...filteredChecks].sort((a, b) => {
|
|
14640
|
+
const aValue = a[sortField];
|
|
14641
|
+
const bValue = b[sortField];
|
|
14642
|
+
if (aValue == null) return 1;
|
|
14643
|
+
if (bValue == null) return -1;
|
|
14644
|
+
if (sortDirection === "asc") {
|
|
14645
|
+
return aValue > bValue ? 1 : -1;
|
|
14646
|
+
} else {
|
|
14647
|
+
return aValue < bValue ? 1 : -1;
|
|
14648
|
+
}
|
|
14649
|
+
});
|
|
14650
|
+
const columns3 = [
|
|
14651
|
+
{
|
|
14652
|
+
key: "created",
|
|
14653
|
+
title: "Created",
|
|
14654
|
+
sortable: true,
|
|
14655
|
+
render: (value) => /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: format(parseISO(value), "MMM d, yyyy h:mm a") })
|
|
14656
|
+
},
|
|
14657
|
+
{
|
|
14658
|
+
key: "entityName",
|
|
14659
|
+
title: "Entity",
|
|
14660
|
+
render: (value, row) => /* @__PURE__ */ jsx(
|
|
14661
|
+
"button",
|
|
14662
|
+
{
|
|
14663
|
+
onClick: () => navigate(getEntityUrl(row.entityType, row.entityId)),
|
|
14664
|
+
className: "text-sm text-primary hover:underline font-medium",
|
|
14665
|
+
children: value
|
|
14666
|
+
}
|
|
14667
|
+
)
|
|
14668
|
+
},
|
|
14669
|
+
{
|
|
14670
|
+
key: "entityType",
|
|
14671
|
+
title: "Entity Type",
|
|
14672
|
+
sortable: true,
|
|
14673
|
+
render: (value) => /* @__PURE__ */ jsx("span", { className: "text-sm", children: value })
|
|
14674
|
+
},
|
|
14675
|
+
{
|
|
14676
|
+
key: "alertId",
|
|
14677
|
+
title: "Alert ID",
|
|
14678
|
+
render: (value) => value ? /* @__PURE__ */ jsx(
|
|
14679
|
+
"button",
|
|
14680
|
+
{
|
|
14681
|
+
onClick: () => navigate(`/alerts/${value}`),
|
|
14682
|
+
className: "text-sm text-primary hover:underline font-medium",
|
|
14683
|
+
children: value
|
|
14684
|
+
}
|
|
14685
|
+
) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "\u2014" })
|
|
14686
|
+
},
|
|
14687
|
+
{
|
|
14688
|
+
key: "status",
|
|
14689
|
+
title: "Status",
|
|
14690
|
+
sortable: true,
|
|
14691
|
+
render: (value) => /* @__PURE__ */ jsx(Badge, { variant: getStatusVariant(value), children: value })
|
|
14692
|
+
}
|
|
14693
|
+
];
|
|
14694
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
|
|
14695
|
+
/* @__PURE__ */ jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-6 max-w-none", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
14696
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold text-foreground", children: "OFAC Checks" }) }),
|
|
14697
|
+
/* @__PURE__ */ jsx(
|
|
14698
|
+
OFACFiltersSheet,
|
|
14699
|
+
{
|
|
14700
|
+
filters,
|
|
14701
|
+
onFilterChange: handleFilterChange,
|
|
14702
|
+
onResetFilters: handleResetFilters
|
|
14703
|
+
}
|
|
14704
|
+
)
|
|
14705
|
+
] }) }) }),
|
|
14706
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsx(
|
|
14707
|
+
DataTable,
|
|
14708
|
+
{
|
|
14709
|
+
columns: columns3,
|
|
14710
|
+
data: sortedChecks,
|
|
14711
|
+
sortBy: sortField,
|
|
14712
|
+
sortDirection,
|
|
14713
|
+
onSort: handleSort
|
|
14714
|
+
}
|
|
14715
|
+
) }) }) })
|
|
14716
|
+
] });
|
|
14717
|
+
}
|
|
14015
14718
|
|
|
14016
|
-
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, 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 };
|
|
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 };
|
|
14017
14720
|
//# sourceMappingURL=index.js.map
|
|
14018
14721
|
//# sourceMappingURL=index.js.map
|