braid-ui 1.0.2 → 1.0.4

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
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var React13 = require('react');
4
- var reactDom = require('react-dom');
5
- var reactSlot = require('@radix-ui/react-slot');
6
4
  var classVarianceAuthority = require('class-variance-authority');
7
5
  var clsx = require('clsx');
8
6
  var tailwindMerge = require('tailwind-merge');
9
7
  var jsxRuntime = require('react/jsx-runtime');
8
+ var reactSlot = require('@radix-ui/react-slot');
10
9
  var lucideReact = require('lucide-react');
10
+ var reactDom = require('react-dom');
11
11
  var SelectPrimitive = require('@radix-ui/react-select');
12
12
  var DialogPrimitive = require('@radix-ui/react-dialog');
13
13
  var reactRouterDom = require('react-router-dom');
@@ -56,10 +56,218 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
56
56
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
57
57
  var ToastPrimitives__namespace = /*#__PURE__*/_interopNamespace(ToastPrimitives);
58
58
 
59
- // src/components/alerts/AlertDocuments.tsx
59
+ // src/components/ui/form-card.tsx
60
60
  function cn(...inputs) {
61
61
  return tailwindMerge.twMerge(clsx.clsx(inputs));
62
62
  }
63
+ var cardVariants = classVarianceAuthority.cva(
64
+ "rounded-lg border bg-card text-card-foreground transition-all duration-200",
65
+ {
66
+ variants: {
67
+ variant: {
68
+ default: "shadow-sm",
69
+ elevated: "shadow-md hover:shadow-lg",
70
+ outlined: "border-2 shadow-none",
71
+ ghost: "border-transparent shadow-none bg-transparent",
72
+ subtle: "border-border/75 shadow-none"
73
+ },
74
+ size: {
75
+ sm: "p-3",
76
+ md: "p-4",
77
+ lg: "p-6",
78
+ none: "p-0"
79
+ },
80
+ fullHeight: {
81
+ true: "h-full flex flex-col",
82
+ false: ""
83
+ },
84
+ interactive: {
85
+ true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
86
+ false: ""
87
+ }
88
+ },
89
+ defaultVariants: {
90
+ variant: "default",
91
+ size: "none",
92
+ fullHeight: false,
93
+ interactive: false
94
+ }
95
+ }
96
+ );
97
+ var Card = React13__namespace.forwardRef(
98
+ ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
99
+ "div",
100
+ {
101
+ ref,
102
+ className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
103
+ ...props
104
+ }
105
+ )
106
+ );
107
+ Card.displayName = "Card";
108
+ var cardHeaderVariants = classVarianceAuthority.cva(
109
+ "flex flex-col space-y-1.5",
110
+ {
111
+ variants: {
112
+ size: {
113
+ sm: "px-3 pt-3 pb-2",
114
+ md: "px-4 pt-4 pb-3",
115
+ lg: "px-6 pt-6 pb-4"
116
+ },
117
+ align: {
118
+ start: "items-start",
119
+ center: "items-center",
120
+ end: "items-end"
121
+ },
122
+ direction: {
123
+ row: "flex-row justify-between items-center space-y-0 space-x-4",
124
+ column: "flex-col space-y-1.5"
125
+ }
126
+ },
127
+ defaultVariants: {
128
+ size: "lg",
129
+ align: "start",
130
+ direction: "column"
131
+ }
132
+ }
133
+ );
134
+ var CardHeader = React13__namespace.forwardRef(
135
+ ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
136
+ "div",
137
+ {
138
+ ref,
139
+ className: cn(cardHeaderVariants({ size, align, direction }), className),
140
+ ...props
141
+ }
142
+ )
143
+ );
144
+ CardHeader.displayName = "CardHeader";
145
+ var cardTitleVariants = classVarianceAuthority.cva(
146
+ "font-semibold leading-none tracking-tight",
147
+ {
148
+ variants: {
149
+ size: {
150
+ sm: "text-base",
151
+ md: "text-lg",
152
+ lg: "text-xl"
153
+ }
154
+ },
155
+ defaultVariants: {
156
+ size: "md"
157
+ }
158
+ }
159
+ );
160
+ var CardTitle = React13__namespace.forwardRef(
161
+ ({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
162
+ "h3",
163
+ {
164
+ ref,
165
+ className: cn(cardTitleVariants({ size }), className),
166
+ ...props
167
+ }
168
+ )
169
+ );
170
+ CardTitle.displayName = "CardTitle";
171
+ var CardDescription = React13__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
172
+ "p",
173
+ {
174
+ ref,
175
+ className: cn("text-sm text-muted-foreground", className),
176
+ ...props
177
+ }
178
+ ));
179
+ CardDescription.displayName = "CardDescription";
180
+ var cardContentVariants = classVarianceAuthority.cva(
181
+ "",
182
+ {
183
+ variants: {
184
+ size: {
185
+ sm: "px-3 pb-2",
186
+ md: "px-4 pb-3",
187
+ lg: "px-6 pb-4"
188
+ },
189
+ fullHeight: {
190
+ true: "flex-1",
191
+ false: ""
192
+ }
193
+ },
194
+ defaultVariants: {
195
+ size: "lg",
196
+ fullHeight: false
197
+ }
198
+ }
199
+ );
200
+ var CardContent = React13__namespace.forwardRef(
201
+ ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
202
+ "div",
203
+ {
204
+ ref,
205
+ className: cn(cardContentVariants({ size, fullHeight }), className),
206
+ ...props
207
+ }
208
+ )
209
+ );
210
+ CardContent.displayName = "CardContent";
211
+ var cardFooterVariants = classVarianceAuthority.cva(
212
+ "flex items-center pt-0",
213
+ {
214
+ variants: {
215
+ size: {
216
+ sm: "p-3 pt-0",
217
+ md: "p-4 pt-0",
218
+ lg: "p-6 pt-0"
219
+ },
220
+ justify: {
221
+ start: "justify-start",
222
+ center: "justify-center",
223
+ end: "justify-end",
224
+ between: "justify-between"
225
+ }
226
+ },
227
+ defaultVariants: {
228
+ size: "lg",
229
+ justify: "start"
230
+ }
231
+ }
232
+ );
233
+ var CardFooter = React13__namespace.forwardRef(
234
+ ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
235
+ "div",
236
+ {
237
+ ref,
238
+ className: cn(cardFooterVariants({ size, justify }), className),
239
+ ...props
240
+ }
241
+ )
242
+ );
243
+ CardFooter.displayName = "CardFooter";
244
+ var FormCard = React13__namespace.forwardRef(
245
+ ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
246
+ Card,
247
+ {
248
+ ref,
249
+ variant,
250
+ fullHeight: true,
251
+ className: cn("", className),
252
+ ...props,
253
+ children: [
254
+ /* @__PURE__ */ jsxRuntime.jsxs(
255
+ CardHeader,
256
+ {
257
+ direction: headerActions ? "row" : "column",
258
+ size: "md",
259
+ children: [
260
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: title }) }),
261
+ headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: headerActions })
262
+ ]
263
+ }
264
+ ),
265
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { size: "md", fullHeight: true, children })
266
+ ]
267
+ }
268
+ )
269
+ );
270
+ FormCard.displayName = "FormCard";
63
271
  var buttonVariants = classVarianceAuthority.cva(
64
272
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
65
273
  {
@@ -99,171 +307,92 @@ var Button = React13__namespace.forwardRef(
99
307
  }
100
308
  );
101
309
  Button.displayName = "Button";
102
- var TOAST_LIMIT = 1;
103
- var TOAST_REMOVE_DELAY = 1e6;
104
- var count = 0;
105
- function genId() {
106
- count = (count + 1) % Number.MAX_SAFE_INTEGER;
107
- return count.toString();
108
- }
109
- var toastTimeouts = /* @__PURE__ */ new Map();
110
- var addToRemoveQueue = (toastId) => {
111
- if (toastTimeouts.has(toastId)) {
112
- return;
113
- }
114
- const timeout = setTimeout(() => {
115
- toastTimeouts.delete(toastId);
116
- dispatch({
117
- type: "REMOVE_TOAST",
118
- toastId
119
- });
120
- }, TOAST_REMOVE_DELAY);
121
- toastTimeouts.set(toastId, timeout);
122
- };
123
- var reducer = (state, action) => {
124
- switch (action.type) {
125
- case "ADD_TOAST":
126
- return {
127
- ...state,
128
- toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
129
- };
130
- case "UPDATE_TOAST":
131
- return {
132
- ...state,
133
- toasts: state.toasts.map(
134
- (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
135
- )
136
- };
137
- case "DISMISS_TOAST": {
138
- const { toastId } = action;
139
- if (toastId) {
140
- addToRemoveQueue(toastId);
141
- } else {
142
- state.toasts.forEach((toast4) => {
143
- addToRemoveQueue(toast4.id);
144
- });
145
- }
146
- return {
147
- ...state,
148
- toasts: state.toasts.map(
149
- (t) => t.id === toastId || toastId === void 0 ? {
150
- ...t,
151
- open: false
152
- } : t
153
- )
154
- };
155
- }
156
- case "REMOVE_TOAST":
157
- if (action.toastId === void 0) {
158
- return {
159
- ...state,
160
- toasts: []
161
- };
162
- }
163
- return {
164
- ...state,
165
- toasts: state.toasts.filter((t) => t.id !== action.toastId)
166
- };
167
- }
168
- };
169
- var listeners = [];
170
- var memoryState = { toasts: [] };
171
- function dispatch(action) {
172
- memoryState = reducer(memoryState, action);
173
- listeners.forEach((listener) => {
174
- listener(memoryState);
175
- });
176
- }
177
- function toast({ ...props }) {
178
- const id = genId();
179
- const update = (props2) => dispatch({
180
- type: "UPDATE_TOAST",
181
- toast: { ...props2, id }
182
- });
183
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
184
- dispatch({
185
- type: "ADD_TOAST",
186
- toast: {
187
- ...props,
188
- id,
189
- open: true,
190
- onOpenChange: (open) => {
191
- if (!open) dismiss();
192
- }
193
- }
194
- });
195
- return {
196
- id,
197
- dismiss,
198
- update
199
- };
200
- }
201
- function useToast() {
202
- const [state, setState] = React13__namespace.useState(memoryState);
203
- React13__namespace.useEffect(() => {
204
- listeners.push(setState);
205
- return () => {
206
- const index = listeners.indexOf(setState);
207
- if (index > -1) {
208
- listeners.splice(index, 1);
209
- }
210
- };
211
- }, [state]);
212
- return {
213
- ...state,
214
- toast,
215
- dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
216
- };
217
- }
218
- var inputVariants = classVarianceAuthority.cva(
219
- "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
310
+ var badgeVariants = classVarianceAuthority.cva(
311
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
220
312
  {
221
313
  variants: {
222
314
  variant: {
223
- default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
224
- error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
225
- success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
226
- disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
227
- readonly: "border border-form-border bg-muted/50 cursor-default"
228
- },
229
- size: {
230
- default: "h-10",
231
- sm: "h-9",
232
- lg: "h-11"
315
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
316
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
317
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
318
+ outline: "text-foreground",
319
+ success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
320
+ warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
321
+ // Business type specific variants
322
+ business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
323
+ individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
324
+ government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
325
+ nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
326
+ // Business entity type variants
327
+ corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
328
+ llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
329
+ partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
330
+ sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
331
+ // Status variants
332
+ active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
333
+ inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
334
+ pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
335
+ suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
336
+ // Alert type subtle variants
337
+ "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
338
+ "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
339
+ "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
340
+ "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
233
341
  }
234
342
  },
235
343
  defaultVariants: {
236
- variant: "default",
237
- size: "default"
344
+ variant: "default"
238
345
  }
239
346
  }
240
347
  );
241
- var EnhancedInput = React13__namespace.forwardRef(
242
- ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
243
- const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
244
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
245
- label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
246
- label,
247
- props.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
348
+ function Badge({ className, variant, ...props }) {
349
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
350
+ }
351
+ var AlertTimeline = ({ events }) => {
352
+ const getIcon = (action) => {
353
+ if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
354
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
355
+ if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
356
+ if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
357
+ if (action.includes("Rejected")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-4 w-4" });
358
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
359
+ };
360
+ const getStatusColor2 = (status) => {
361
+ switch (status) {
362
+ case "Unassigned":
363
+ return "text-destructive";
364
+ case "Closed":
365
+ return "text-success";
366
+ case "In Progress":
367
+ return "text-warning";
368
+ default:
369
+ return "text-muted-foreground";
370
+ }
371
+ };
372
+ if (events.length === 0) {
373
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
374
+ }
375
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
376
+ index !== events.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
377
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
378
+ "absolute left-0 top-0 flex-none",
379
+ getStatusColor2(event.status)
380
+ ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
381
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
382
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
383
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
384
+ "by ",
385
+ event.user
248
386
  ] }),
249
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
250
- /* @__PURE__ */ jsxRuntime.jsx(
251
- "input",
252
- {
253
- className: cn(inputVariants({ variant: inputVariant, size, className })),
254
- ref,
255
- ...props
256
- }
257
- ),
258
- isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
387
+ event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
388
+ event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
389
+ "Status: ",
390
+ event.status
259
391
  ] }),
260
- hint && !error && !success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
261
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error }),
262
- success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-success", children: success })
263
- ] });
264
- }
265
- );
266
- EnhancedInput.displayName = "EnhancedInput";
392
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
393
+ ] })
394
+ ] }, event.id)) });
395
+ };
267
396
  var textareaVariants = classVarianceAuthority.cva(
268
397
  "flex min-h-[80px] w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground transition-form resize-y",
269
398
  {
@@ -360,179 +489,208 @@ var EnhancedSelect = React13__namespace.forwardRef(({ variant, label, hint, erro
360
489
  ] });
361
490
  });
362
491
  EnhancedSelect.displayName = "EnhancedSelect";
363
- var AlertDocuments = ({ alertId, documents }) => {
364
- const [isUploading, setIsUploading] = React13.useState(false);
365
- const [showUploadDialog, setShowUploadDialog] = React13.useState(false);
366
- const [selectedFile, setSelectedFile] = React13.useState(null);
367
- const [documentName, setDocumentName] = React13.useState("");
368
- const [description, setDescription] = React13.useState("");
369
- const [documentType, setDocumentType] = React13.useState("");
370
- const handleFileSelect = (e) => {
371
- const file = e.target.files?.[0];
372
- if (!file) return;
373
- setSelectedFile(file);
374
- setDocumentName(file.name);
375
- };
376
- const handleUploadSubmit = () => {
377
- if (!selectedFile || !documentName || !documentType) {
378
- toast({
379
- title: "Missing Information",
380
- description: "Please fill in all required fields",
381
- variant: "destructive"
382
- });
383
- return;
492
+ var TOAST_LIMIT = 1;
493
+ var TOAST_REMOVE_DELAY = 1e6;
494
+ var count = 0;
495
+ function genId() {
496
+ count = (count + 1) % Number.MAX_SAFE_INTEGER;
497
+ return count.toString();
498
+ }
499
+ var toastTimeouts = /* @__PURE__ */ new Map();
500
+ var addToRemoveQueue = (toastId) => {
501
+ if (toastTimeouts.has(toastId)) {
502
+ return;
503
+ }
504
+ const timeout = setTimeout(() => {
505
+ toastTimeouts.delete(toastId);
506
+ dispatch({
507
+ type: "REMOVE_TOAST",
508
+ toastId
509
+ });
510
+ }, TOAST_REMOVE_DELAY);
511
+ toastTimeouts.set(toastId, timeout);
512
+ };
513
+ var reducer = (state, action) => {
514
+ switch (action.type) {
515
+ case "ADD_TOAST":
516
+ return {
517
+ ...state,
518
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
519
+ };
520
+ case "UPDATE_TOAST":
521
+ return {
522
+ ...state,
523
+ toasts: state.toasts.map(
524
+ (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
525
+ )
526
+ };
527
+ case "DISMISS_TOAST": {
528
+ const { toastId } = action;
529
+ if (toastId) {
530
+ addToRemoveQueue(toastId);
531
+ } else {
532
+ state.toasts.forEach((toast4) => {
533
+ addToRemoveQueue(toast4.id);
534
+ });
535
+ }
536
+ return {
537
+ ...state,
538
+ toasts: state.toasts.map(
539
+ (t) => t.id === toastId || toastId === void 0 ? {
540
+ ...t,
541
+ open: false
542
+ } : t
543
+ )
544
+ };
384
545
  }
385
- setIsUploading(true);
386
- setTimeout(() => {
387
- ({
388
- size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
389
- uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
390
- });
391
- toast({
392
- title: "Upload Successful",
393
- description: `${documentName} uploaded successfully`
394
- });
395
- setIsUploading(false);
396
- setShowUploadDialog(false);
397
- resetForm();
398
- }, 1e3);
546
+ case "REMOVE_TOAST":
547
+ if (action.toastId === void 0) {
548
+ return {
549
+ ...state,
550
+ toasts: []
551
+ };
552
+ }
553
+ return {
554
+ ...state,
555
+ toasts: state.toasts.filter((t) => t.id !== action.toastId)
556
+ };
557
+ }
558
+ };
559
+ var listeners = [];
560
+ var memoryState = { toasts: [] };
561
+ function dispatch(action) {
562
+ memoryState = reducer(memoryState, action);
563
+ listeners.forEach((listener) => {
564
+ listener(memoryState);
565
+ });
566
+ }
567
+ function toast({ ...props }) {
568
+ const id = genId();
569
+ const update = (props2) => dispatch({
570
+ type: "UPDATE_TOAST",
571
+ toast: { ...props2, id }
572
+ });
573
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
574
+ dispatch({
575
+ type: "ADD_TOAST",
576
+ toast: {
577
+ ...props,
578
+ id,
579
+ open: true,
580
+ onOpenChange: (open) => {
581
+ if (!open) dismiss();
582
+ }
583
+ }
584
+ });
585
+ return {
586
+ id,
587
+ dismiss,
588
+ update
589
+ };
590
+ }
591
+ function useToast() {
592
+ const [state, setState] = React13__namespace.useState(memoryState);
593
+ React13__namespace.useEffect(() => {
594
+ listeners.push(setState);
595
+ return () => {
596
+ const index = listeners.indexOf(setState);
597
+ if (index > -1) {
598
+ listeners.splice(index, 1);
599
+ }
600
+ };
601
+ }, [state]);
602
+ return {
603
+ ...state,
604
+ toast,
605
+ dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
399
606
  };
607
+ }
608
+ var NOTE_TYPE_OPTIONS = [
609
+ { value: "RFI Note", label: "RFI Note" },
610
+ { value: "Internal Note", label: "Internal Note" }
611
+ ];
612
+ var AlertNotes = ({ alertId, notes }) => {
613
+ const [showNoteDialog, setShowNoteDialog] = React13.useState(false);
614
+ const [newNote, setNewNote] = React13.useState("");
615
+ const [noteType, setNoteType] = React13.useState("RFI Note");
616
+ const [isSubmitting, setIsSubmitting] = React13.useState(false);
400
617
  const resetForm = () => {
401
- setSelectedFile(null);
402
- setDocumentName("");
403
- setDescription("");
404
- setDocumentType("");
405
- const fileInput = document.getElementById("file-upload");
406
- if (fileInput) fileInput.value = "";
618
+ setNewNote("");
619
+ setNoteType("RFI Note");
407
620
  };
408
- const handleCancelUpload = () => {
409
- setShowUploadDialog(false);
621
+ const handleCancelNote = () => {
622
+ setShowNoteDialog(false);
410
623
  resetForm();
411
624
  };
412
- const isImageType = (name) => {
413
- const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
414
- return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
415
- };
416
- const getFileIcon = (type) => {
417
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
418
- };
419
- const getFileTypeColor = (type) => {
420
- switch (type.toUpperCase()) {
421
- case "PDF":
422
- return "text-red-500";
423
- case "DOCX":
424
- case "DOC":
425
- return "text-blue-500";
426
- case "XLSX":
427
- case "XLS":
428
- return "text-green-500";
429
- case "JPG":
430
- case "JPEG":
431
- case "PNG":
432
- return "text-purple-500";
433
- default:
434
- return "text-muted-foreground";
625
+ const handleAddNote = async () => {
626
+ if (!newNote.trim()) {
627
+ toast({
628
+ title: "Error",
629
+ description: "Please enter a note before submitting",
630
+ variant: "destructive"
631
+ });
632
+ return;
435
633
  }
634
+ setIsSubmitting(true);
635
+ setTimeout(() => {
636
+ toast({
637
+ title: "Note Added",
638
+ description: "Your note has been added successfully"
639
+ });
640
+ setShowNoteDialog(false);
641
+ resetForm();
642
+ setIsSubmitting(false);
643
+ }, 500);
644
+ };
645
+ const handleDeleteNote = (noteId, noteContent) => {
646
+ toast({
647
+ title: "Note Deleted",
648
+ description: `Note deleted successfully`
649
+ });
650
+ console.log("Deleting note:", noteId);
436
651
  };
437
- const documentTypeOptions = [
438
- { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
439
- { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
440
- { value: "PASSPORT", label: "Passport" },
441
- { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
442
- { value: "BANK_STATEMENT", label: "Bank Statement" },
443
- { value: "BUSINESS_LICENSE", label: "Business License" },
444
- { value: "TAX_DOCUMENT", label: "Tax Document" },
445
- { value: "OTHER", label: "Other" }
446
- ];
447
652
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
448
- showUploadDialog && reactDom.createPortal(
653
+ showNoteDialog && reactDom.createPortal(
449
654
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
450
655
  /* @__PURE__ */ jsxRuntime.jsx(
451
656
  "div",
452
657
  {
453
658
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
454
- onClick: handleCancelUpload
659
+ onClick: handleCancelNote
455
660
  }
456
661
  ),
457
662
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
458
663
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
459
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
664
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
460
665
  /* @__PURE__ */ jsxRuntime.jsx(
461
666
  Button,
462
667
  {
463
668
  variant: "ghost",
464
669
  size: "sm",
465
670
  className: "h-8 w-8 p-0",
466
- onClick: handleCancelUpload,
671
+ onClick: handleCancelNote,
467
672
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
468
673
  }
469
674
  )
470
675
  ] }),
471
676
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
472
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
473
- /* @__PURE__ */ jsxRuntime.jsx(
474
- "input",
475
- {
476
- type: "file",
477
- id: "file-upload-dialog",
478
- className: "hidden",
479
- onChange: handleFileSelect,
480
- disabled: isUploading
481
- }
482
- ),
483
- /* @__PURE__ */ jsxRuntime.jsxs(
484
- "label",
485
- {
486
- htmlFor: "file-upload-dialog",
487
- className: cn(
488
- "cursor-pointer flex flex-col items-center gap-2",
489
- isUploading && "opacity-50 cursor-not-allowed"
490
- ),
491
- children: [
492
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
493
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
494
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
495
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
496
- ] })
497
- ]
498
- }
499
- )
500
- ] }),
501
- selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
502
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
503
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
504
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
505
- (selectedFile.size / 1024 / 1024).toFixed(2),
506
- " MB"
507
- ] })
508
- ] }),
509
677
  /* @__PURE__ */ jsxRuntime.jsx(
510
- EnhancedInput,
678
+ EnhancedSelect,
511
679
  {
512
- label: "Document name",
513
- value: documentName,
514
- onChange: (e) => setDocumentName(e.target.value),
515
- placeholder: "Enter document name"
680
+ label: "Note Type",
681
+ value: noteType,
682
+ onValueChange: (value) => setNoteType(value),
683
+ options: NOTE_TYPE_OPTIONS
516
684
  }
517
685
  ),
518
686
  /* @__PURE__ */ jsxRuntime.jsx(
519
687
  EnhancedTextarea,
520
688
  {
521
- label: "Description",
522
- value: description,
523
- onChange: (e) => setDescription(e.target.value),
524
- placeholder: "Enter document description (optional)",
525
- rows: 3
526
- }
527
- ),
528
- /* @__PURE__ */ jsxRuntime.jsx(
529
- EnhancedSelect,
530
- {
531
- label: "Document type",
532
- value: documentType,
533
- onValueChange: setDocumentType,
534
- placeholder: "Select document type",
535
- options: documentTypeOptions
689
+ label: "Note",
690
+ placeholder: "Enter your note here...",
691
+ value: newNote,
692
+ onChange: (e) => setNewNote(e.target.value),
693
+ rows: 6
536
694
  }
537
695
  )
538
696
  ] }),
@@ -541,8 +699,8 @@ var AlertDocuments = ({ alertId, documents }) => {
541
699
  Button,
542
700
  {
543
701
  variant: "outline",
544
- onClick: handleCancelUpload,
545
- disabled: isUploading,
702
+ onClick: handleCancelNote,
703
+ disabled: isSubmitting,
546
704
  className: "flex-1",
547
705
  children: "Cancel"
548
706
  }
@@ -550,10 +708,10 @@ var AlertDocuments = ({ alertId, documents }) => {
550
708
  /* @__PURE__ */ jsxRuntime.jsx(
551
709
  Button,
552
710
  {
553
- onClick: handleUploadSubmit,
554
- disabled: isUploading,
711
+ onClick: handleAddNote,
712
+ disabled: isSubmitting || !newNote.trim(),
555
713
  className: "flex-1",
556
- children: isUploading ? "Uploading..." : "Upload"
714
+ children: isSubmitting ? "Adding..." : "Add Note"
557
715
  }
558
716
  )
559
717
  ] })
@@ -561,224 +719,280 @@ var AlertDocuments = ({ alertId, documents }) => {
561
719
  ] }),
562
720
  document.body
563
721
  ),
564
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
722
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
565
723
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
566
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
724
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
567
725
  /* @__PURE__ */ jsxRuntime.jsxs(
568
726
  Button,
569
727
  {
570
- onClick: () => setShowUploadDialog(true),
728
+ onClick: () => setShowNoteDialog(true),
571
729
  variant: "ghost",
572
730
  size: "sm",
573
731
  className: "gap-2 text-primary hover:text-primary",
574
732
  children: [
575
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
576
- "Upload"
733
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
734
+ "Add Note"
577
735
  ]
578
736
  }
579
737
  )
580
738
  ] }),
581
- documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
582
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
583
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
584
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
585
- "div",
586
- {
587
- className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
739
+ notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
740
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
741
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No notes yet" })
742
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxRuntime.jsxs(
743
+ "div",
744
+ {
745
+ className: "border rounded-lg p-4 bg-muted/30",
588
746
  children: [
589
- isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
590
- "img",
591
- {
592
- src: doc.url,
593
- alt: doc.name,
594
- className: "w-full h-48 object-cover"
595
- }
596
- ) }),
597
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
598
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
599
- !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
600
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
601
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
602
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
603
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
604
- ] }),
605
- doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
606
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
607
- doc.size,
608
- " \u2022 Uploaded by ",
609
- doc.uploadedBy,
610
- " \u2022 ",
611
- new Date(doc.uploadedAt).toLocaleDateString()
612
- ] })
613
- ] })
747
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
748
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
749
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
750
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
614
751
  ] }),
615
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
616
- /* @__PURE__ */ jsxRuntime.jsx(
617
- Button,
618
- {
619
- variant: "ghost",
620
- size: "sm",
621
- className: "h-8 w-8 p-0",
622
- onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
623
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
624
- }
625
- ),
626
- /* @__PURE__ */ jsxRuntime.jsx(
627
- Button,
628
- {
629
- variant: "ghost",
630
- size: "sm",
631
- className: "h-8 w-8 p-0",
632
- onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
633
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
634
- }
635
- ),
752
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
753
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
636
754
  /* @__PURE__ */ jsxRuntime.jsx(
637
755
  Button,
638
756
  {
639
757
  variant: "ghost",
640
758
  size: "sm",
641
759
  className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
642
- onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
760
+ onClick: () => handleDeleteNote(note.id, note.content),
643
761
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
644
762
  }
645
763
  )
646
764
  ] })
647
- ] })
765
+ ] }),
766
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: note.content })
648
767
  ]
649
768
  },
650
- doc.id
769
+ note.id
651
770
  )) })
652
771
  ] })
653
772
  ] });
654
773
  };
655
- var badgeVariants = classVarianceAuthority.cva(
656
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
774
+ var inputVariants = classVarianceAuthority.cva(
775
+ "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
657
776
  {
658
777
  variants: {
659
778
  variant: {
660
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
661
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
662
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
663
- outline: "text-foreground",
664
- success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
665
- warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
666
- // Business type specific variants
667
- business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
668
- individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
669
- government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
670
- nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
671
- // Business entity type variants
672
- corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
673
- llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
674
- partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
675
- sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
676
- // Status variants
677
- active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
678
- inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
679
- pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
680
- suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
681
- // Alert type subtle variants
682
- "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
683
- "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
684
- "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
685
- "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
779
+ default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
780
+ error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
781
+ success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
782
+ disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
783
+ readonly: "border border-form-border bg-muted/50 cursor-default"
784
+ },
785
+ size: {
786
+ default: "h-10",
787
+ sm: "h-9",
788
+ lg: "h-11"
686
789
  }
687
790
  },
688
791
  defaultVariants: {
689
- variant: "default"
792
+ variant: "default",
793
+ size: "default"
690
794
  }
691
795
  }
692
796
  );
693
- function Badge({ className, variant, ...props }) {
694
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
695
- }
696
- var NOTE_TYPE_OPTIONS = [
697
- { value: "RFI Note", label: "RFI Note" },
698
- { value: "Internal Note", label: "Internal Note" }
699
- ];
700
- var AlertNotes = ({ alertId, notes }) => {
701
- const [showNoteDialog, setShowNoteDialog] = React13.useState(false);
702
- const [newNote, setNewNote] = React13.useState("");
703
- const [noteType, setNoteType] = React13.useState("RFI Note");
704
- const [isSubmitting, setIsSubmitting] = React13.useState(false);
705
- const resetForm = () => {
706
- setNewNote("");
707
- setNoteType("RFI Note");
708
- };
709
- const handleCancelNote = () => {
710
- setShowNoteDialog(false);
711
- resetForm();
797
+ var EnhancedInput = React13__namespace.forwardRef(
798
+ ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
799
+ const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
800
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
801
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
802
+ label,
803
+ props.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
804
+ ] }),
805
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
806
+ /* @__PURE__ */ jsxRuntime.jsx(
807
+ "input",
808
+ {
809
+ className: cn(inputVariants({ variant: inputVariant, size, className })),
810
+ ref,
811
+ ...props
812
+ }
813
+ ),
814
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
815
+ ] }),
816
+ hint && !error && !success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
817
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error }),
818
+ success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-success", children: success })
819
+ ] });
820
+ }
821
+ );
822
+ EnhancedInput.displayName = "EnhancedInput";
823
+ var AlertDocuments = ({ alertId, documents }) => {
824
+ const [isUploading, setIsUploading] = React13.useState(false);
825
+ const [showUploadDialog, setShowUploadDialog] = React13.useState(false);
826
+ const [selectedFile, setSelectedFile] = React13.useState(null);
827
+ const [documentName, setDocumentName] = React13.useState("");
828
+ const [description, setDescription] = React13.useState("");
829
+ const [documentType, setDocumentType] = React13.useState("");
830
+ const handleFileSelect = (e) => {
831
+ const file = e.target.files?.[0];
832
+ if (!file) return;
833
+ setSelectedFile(file);
834
+ setDocumentName(file.name);
712
835
  };
713
- const handleAddNote = async () => {
714
- if (!newNote.trim()) {
836
+ const handleUploadSubmit = () => {
837
+ if (!selectedFile || !documentName || !documentType) {
715
838
  toast({
716
- title: "Error",
717
- description: "Please enter a note before submitting",
839
+ title: "Missing Information",
840
+ description: "Please fill in all required fields",
718
841
  variant: "destructive"
719
842
  });
720
843
  return;
721
844
  }
722
- setIsSubmitting(true);
845
+ setIsUploading(true);
723
846
  setTimeout(() => {
847
+ ({
848
+ size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
849
+ uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
850
+ });
724
851
  toast({
725
- title: "Note Added",
726
- description: "Your note has been added successfully"
852
+ title: "Upload Successful",
853
+ description: `${documentName} uploaded successfully`
727
854
  });
728
- setShowNoteDialog(false);
855
+ setIsUploading(false);
856
+ setShowUploadDialog(false);
729
857
  resetForm();
730
- setIsSubmitting(false);
731
- }, 500);
858
+ }, 1e3);
732
859
  };
733
- const handleDeleteNote = (noteId, noteContent) => {
734
- toast({
735
- title: "Note Deleted",
736
- description: `Note deleted successfully`
737
- });
738
- console.log("Deleting note:", noteId);
860
+ const resetForm = () => {
861
+ setSelectedFile(null);
862
+ setDocumentName("");
863
+ setDescription("");
864
+ setDocumentType("");
865
+ const fileInput = document.getElementById("file-upload");
866
+ if (fileInput) fileInput.value = "";
867
+ };
868
+ const handleCancelUpload = () => {
869
+ setShowUploadDialog(false);
870
+ resetForm();
871
+ };
872
+ const isImageType = (name) => {
873
+ const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
874
+ return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
875
+ };
876
+ const getFileIcon = (type) => {
877
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
878
+ };
879
+ const getFileTypeColor = (type) => {
880
+ switch (type.toUpperCase()) {
881
+ case "PDF":
882
+ return "text-red-500";
883
+ case "DOCX":
884
+ case "DOC":
885
+ return "text-blue-500";
886
+ case "XLSX":
887
+ case "XLS":
888
+ return "text-green-500";
889
+ case "JPG":
890
+ case "JPEG":
891
+ case "PNG":
892
+ return "text-purple-500";
893
+ default:
894
+ return "text-muted-foreground";
895
+ }
739
896
  };
897
+ const documentTypeOptions = [
898
+ { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
899
+ { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
900
+ { value: "PASSPORT", label: "Passport" },
901
+ { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
902
+ { value: "BANK_STATEMENT", label: "Bank Statement" },
903
+ { value: "BUSINESS_LICENSE", label: "Business License" },
904
+ { value: "TAX_DOCUMENT", label: "Tax Document" },
905
+ { value: "OTHER", label: "Other" }
906
+ ];
740
907
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
741
- showNoteDialog && reactDom.createPortal(
908
+ showUploadDialog && reactDom.createPortal(
742
909
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
743
910
  /* @__PURE__ */ jsxRuntime.jsx(
744
911
  "div",
745
912
  {
746
913
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
747
- onClick: handleCancelNote
914
+ onClick: handleCancelUpload
748
915
  }
749
916
  ),
750
917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
751
918
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
752
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
919
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
753
920
  /* @__PURE__ */ jsxRuntime.jsx(
754
921
  Button,
755
922
  {
756
923
  variant: "ghost",
757
924
  size: "sm",
758
925
  className: "h-8 w-8 p-0",
759
- onClick: handleCancelNote,
926
+ onClick: handleCancelUpload,
760
927
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
761
928
  }
762
929
  )
763
930
  ] }),
764
931
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
765
- /* @__PURE__ */ jsxRuntime.jsx(
766
- EnhancedSelect,
767
- {
768
- label: "Note Type",
769
- value: noteType,
770
- onValueChange: (value) => setNoteType(value),
771
- options: NOTE_TYPE_OPTIONS
932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
933
+ /* @__PURE__ */ jsxRuntime.jsx(
934
+ "input",
935
+ {
936
+ type: "file",
937
+ id: "file-upload-dialog",
938
+ className: "hidden",
939
+ onChange: handleFileSelect,
940
+ disabled: isUploading
941
+ }
942
+ ),
943
+ /* @__PURE__ */ jsxRuntime.jsxs(
944
+ "label",
945
+ {
946
+ htmlFor: "file-upload-dialog",
947
+ className: cn(
948
+ "cursor-pointer flex flex-col items-center gap-2",
949
+ isUploading && "opacity-50 cursor-not-allowed"
950
+ ),
951
+ children: [
952
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
953
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
954
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
955
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
956
+ ] })
957
+ ]
958
+ }
959
+ )
960
+ ] }),
961
+ selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
962
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
963
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
964
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
965
+ (selectedFile.size / 1024 / 1024).toFixed(2),
966
+ " MB"
967
+ ] })
968
+ ] }),
969
+ /* @__PURE__ */ jsxRuntime.jsx(
970
+ EnhancedInput,
971
+ {
972
+ label: "Document name",
973
+ value: documentName,
974
+ onChange: (e) => setDocumentName(e.target.value),
975
+ placeholder: "Enter document name"
772
976
  }
773
977
  ),
774
978
  /* @__PURE__ */ jsxRuntime.jsx(
775
979
  EnhancedTextarea,
776
980
  {
777
- label: "Note",
778
- placeholder: "Enter your note here...",
779
- value: newNote,
780
- onChange: (e) => setNewNote(e.target.value),
781
- rows: 6
981
+ label: "Description",
982
+ value: description,
983
+ onChange: (e) => setDescription(e.target.value),
984
+ placeholder: "Enter document description (optional)",
985
+ rows: 3
986
+ }
987
+ ),
988
+ /* @__PURE__ */ jsxRuntime.jsx(
989
+ EnhancedSelect,
990
+ {
991
+ label: "Document type",
992
+ value: documentType,
993
+ onValueChange: setDocumentType,
994
+ placeholder: "Select document type",
995
+ options: documentTypeOptions
782
996
  }
783
997
  )
784
998
  ] }),
@@ -787,8 +1001,8 @@ var AlertNotes = ({ alertId, notes }) => {
787
1001
  Button,
788
1002
  {
789
1003
  variant: "outline",
790
- onClick: handleCancelNote,
791
- disabled: isSubmitting,
1004
+ onClick: handleCancelUpload,
1005
+ disabled: isUploading,
792
1006
  className: "flex-1",
793
1007
  children: "Cancel"
794
1008
  }
@@ -796,10 +1010,10 @@ var AlertNotes = ({ alertId, notes }) => {
796
1010
  /* @__PURE__ */ jsxRuntime.jsx(
797
1011
  Button,
798
1012
  {
799
- onClick: handleAddNote,
800
- disabled: isSubmitting || !newNote.trim(),
1013
+ onClick: handleUploadSubmit,
1014
+ disabled: isUploading,
801
1015
  className: "flex-1",
802
- children: isSubmitting ? "Adding..." : "Add Note"
1016
+ children: isUploading ? "Uploading..." : "Upload"
803
1017
  }
804
1018
  )
805
1019
  ] })
@@ -807,311 +1021,97 @@ var AlertNotes = ({ alertId, notes }) => {
807
1021
  ] }),
808
1022
  document.body
809
1023
  ),
810
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1024
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
811
1025
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
812
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
1026
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
813
1027
  /* @__PURE__ */ jsxRuntime.jsxs(
814
1028
  Button,
815
1029
  {
816
- onClick: () => setShowNoteDialog(true),
1030
+ onClick: () => setShowUploadDialog(true),
817
1031
  variant: "ghost",
818
1032
  size: "sm",
819
1033
  className: "gap-2 text-primary hover:text-primary",
820
1034
  children: [
821
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
822
- "Add Note"
1035
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
1036
+ "Upload"
823
1037
  ]
824
1038
  }
825
1039
  )
826
1040
  ] }),
827
- notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
828
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
829
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No notes yet" })
830
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxRuntime.jsxs(
1041
+ documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
1042
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
1043
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
1044
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
831
1045
  "div",
832
1046
  {
833
- className: "border rounded-lg p-4 bg-muted/30",
1047
+ className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
834
1048
  children: [
835
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
836
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
837
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
838
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
839
- ] }),
840
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
841
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
842
- /* @__PURE__ */ jsxRuntime.jsx(
843
- Button,
844
- {
845
- variant: "ghost",
846
- size: "sm",
847
- className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
848
- onClick: () => handleDeleteNote(note.id, note.content),
849
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
850
- }
851
- )
852
- ] })
853
- ] }),
854
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: note.content })
855
- ]
856
- },
857
- note.id
858
- )) })
859
- ] })
860
- ] });
861
- };
862
- var AlertTimeline = ({ events }) => {
863
- const getIcon = (action) => {
864
- if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
865
- if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
866
- if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
867
- if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
868
- if (action.includes("Rejected")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-4 w-4" });
869
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
870
- };
871
- const getStatusColor = (status) => {
872
- switch (status) {
873
- case "Unassigned":
874
- return "text-destructive";
875
- case "Closed":
876
- return "text-success";
877
- case "In Progress":
878
- return "text-warning";
879
- default:
880
- return "text-muted-foreground";
881
- }
882
- };
883
- if (events.length === 0) {
884
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
885
- }
886
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
887
- index !== events.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
888
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
889
- "absolute left-0 top-0 flex-none",
890
- getStatusColor(event.status)
891
- ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
892
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
893
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
894
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
895
- "by ",
896
- event.user
897
- ] }),
898
- event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
899
- event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor(event.status)), children: [
900
- "Status: ",
901
- event.status
902
- ] }),
903
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
904
- ] })
905
- ] }, event.id)) });
906
- };
907
- var cardVariants = classVarianceAuthority.cva(
908
- "rounded-lg border bg-card text-card-foreground transition-all duration-200",
909
- {
910
- variants: {
911
- variant: {
912
- default: "shadow-sm",
913
- elevated: "shadow-md hover:shadow-lg",
914
- outlined: "border-2 shadow-none",
915
- ghost: "border-transparent shadow-none bg-transparent",
916
- subtle: "border-border/75 shadow-none"
917
- },
918
- size: {
919
- sm: "p-3",
920
- md: "p-4",
921
- lg: "p-6",
922
- none: "p-0"
923
- },
924
- fullHeight: {
925
- true: "h-full flex flex-col",
926
- false: ""
927
- },
928
- interactive: {
929
- true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
930
- false: ""
931
- }
932
- },
933
- defaultVariants: {
934
- variant: "default",
935
- size: "none",
936
- fullHeight: false,
937
- interactive: false
938
- }
939
- }
940
- );
941
- var Card = React13__namespace.forwardRef(
942
- ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
943
- "div",
944
- {
945
- ref,
946
- className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
947
- ...props
948
- }
949
- )
950
- );
951
- Card.displayName = "Card";
952
- var cardHeaderVariants = classVarianceAuthority.cva(
953
- "flex flex-col space-y-1.5",
954
- {
955
- variants: {
956
- size: {
957
- sm: "px-3 pt-3 pb-2",
958
- md: "px-4 pt-4 pb-3",
959
- lg: "px-6 pt-6 pb-4"
960
- },
961
- align: {
962
- start: "items-start",
963
- center: "items-center",
964
- end: "items-end"
965
- },
966
- direction: {
967
- row: "flex-row justify-between items-center space-y-0 space-x-4",
968
- column: "flex-col space-y-1.5"
969
- }
970
- },
971
- defaultVariants: {
972
- size: "lg",
973
- align: "start",
974
- direction: "column"
975
- }
976
- }
977
- );
978
- var CardHeader = React13__namespace.forwardRef(
979
- ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
980
- "div",
981
- {
982
- ref,
983
- className: cn(cardHeaderVariants({ size, align, direction }), className),
984
- ...props
985
- }
986
- )
987
- );
988
- CardHeader.displayName = "CardHeader";
989
- var cardTitleVariants = classVarianceAuthority.cva(
990
- "font-semibold leading-none tracking-tight",
991
- {
992
- variants: {
993
- size: {
994
- sm: "text-base",
995
- md: "text-lg",
996
- lg: "text-xl"
997
- }
998
- },
999
- defaultVariants: {
1000
- size: "md"
1001
- }
1002
- }
1003
- );
1004
- var CardTitle = React13__namespace.forwardRef(
1005
- ({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1006
- "h3",
1007
- {
1008
- ref,
1009
- className: cn(cardTitleVariants({ size }), className),
1010
- ...props
1011
- }
1012
- )
1013
- );
1014
- CardTitle.displayName = "CardTitle";
1015
- var CardDescription = React13__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1016
- "p",
1017
- {
1018
- ref,
1019
- className: cn("text-sm text-muted-foreground", className),
1020
- ...props
1021
- }
1022
- ));
1023
- CardDescription.displayName = "CardDescription";
1024
- var cardContentVariants = classVarianceAuthority.cva(
1025
- "",
1026
- {
1027
- variants: {
1028
- size: {
1029
- sm: "px-3 pb-2",
1030
- md: "px-4 pb-3",
1031
- lg: "px-6 pb-4"
1032
- },
1033
- fullHeight: {
1034
- true: "flex-1",
1035
- false: ""
1036
- }
1037
- },
1038
- defaultVariants: {
1039
- size: "lg",
1040
- fullHeight: false
1041
- }
1042
- }
1043
- );
1044
- var CardContent = React13__namespace.forwardRef(
1045
- ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1046
- "div",
1047
- {
1048
- ref,
1049
- className: cn(cardContentVariants({ size, fullHeight }), className),
1050
- ...props
1051
- }
1052
- )
1053
- );
1054
- CardContent.displayName = "CardContent";
1055
- var cardFooterVariants = classVarianceAuthority.cva(
1056
- "flex items-center pt-0",
1057
- {
1058
- variants: {
1059
- size: {
1060
- sm: "p-3 pt-0",
1061
- md: "p-4 pt-0",
1062
- lg: "p-6 pt-0"
1063
- },
1064
- justify: {
1065
- start: "justify-start",
1066
- center: "justify-center",
1067
- end: "justify-end",
1068
- between: "justify-between"
1069
- }
1070
- },
1071
- defaultVariants: {
1072
- size: "lg",
1073
- justify: "start"
1074
- }
1075
- }
1076
- );
1077
- var CardFooter = React13__namespace.forwardRef(
1078
- ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1079
- "div",
1080
- {
1081
- ref,
1082
- className: cn(cardFooterVariants({ size, justify }), className),
1083
- ...props
1084
- }
1085
- )
1086
- );
1087
- CardFooter.displayName = "CardFooter";
1088
- var FormCard = React13__namespace.forwardRef(
1089
- ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1090
- Card,
1091
- {
1092
- ref,
1093
- variant,
1094
- fullHeight: true,
1095
- className: cn("", className),
1096
- ...props,
1097
- children: [
1098
- /* @__PURE__ */ jsxRuntime.jsxs(
1099
- CardHeader,
1100
- {
1101
- direction: headerActions ? "row" : "column",
1102
- size: "md",
1103
- children: [
1104
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: title }) }),
1105
- headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: headerActions })
1106
- ]
1107
- }
1108
- ),
1109
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { size: "md", fullHeight: true, children })
1110
- ]
1111
- }
1112
- )
1113
- );
1114
- FormCard.displayName = "FormCard";
1049
+ isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
1050
+ "img",
1051
+ {
1052
+ src: doc.url,
1053
+ alt: doc.name,
1054
+ className: "w-full h-48 object-cover"
1055
+ }
1056
+ ) }),
1057
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
1058
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
1059
+ !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
1060
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
1061
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1062
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
1063
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
1064
+ ] }),
1065
+ doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
1066
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
1067
+ doc.size,
1068
+ " \u2022 Uploaded by ",
1069
+ doc.uploadedBy,
1070
+ " \u2022 ",
1071
+ new Date(doc.uploadedAt).toLocaleDateString()
1072
+ ] })
1073
+ ] })
1074
+ ] }),
1075
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
1076
+ /* @__PURE__ */ jsxRuntime.jsx(
1077
+ Button,
1078
+ {
1079
+ variant: "ghost",
1080
+ size: "sm",
1081
+ className: "h-8 w-8 p-0",
1082
+ onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
1083
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
1084
+ }
1085
+ ),
1086
+ /* @__PURE__ */ jsxRuntime.jsx(
1087
+ Button,
1088
+ {
1089
+ variant: "ghost",
1090
+ size: "sm",
1091
+ className: "h-8 w-8 p-0",
1092
+ onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
1093
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
1094
+ }
1095
+ ),
1096
+ /* @__PURE__ */ jsxRuntime.jsx(
1097
+ Button,
1098
+ {
1099
+ variant: "ghost",
1100
+ size: "sm",
1101
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
1102
+ onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
1103
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
1104
+ }
1105
+ )
1106
+ ] })
1107
+ ] })
1108
+ ]
1109
+ },
1110
+ doc.id
1111
+ )) })
1112
+ ] })
1113
+ ] });
1114
+ };
1115
1115
  var InfoField = ({ label, value, layout = "vertical", className }) => {
1116
1116
  if (layout === "horizontal") {
1117
1117
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start gap-3 ${className || ""}`, children: [
@@ -1424,6 +1424,184 @@ var ContextSection = ({ alert }) => {
1424
1424
  ] }) })
1425
1425
  ] });
1426
1426
  };
1427
+ var EditableInfoField = ({
1428
+ label,
1429
+ value,
1430
+ options,
1431
+ onChange,
1432
+ placeholder = "Select...",
1433
+ renderValue,
1434
+ className
1435
+ }) => {
1436
+ const [isEditing, setIsEditing] = React13.useState(false);
1437
+ const handleChange = (newValue) => {
1438
+ onChange(newValue);
1439
+ setIsEditing(false);
1440
+ };
1441
+ if (isEditing) {
1442
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
1443
+ EnhancedSelect,
1444
+ {
1445
+ label,
1446
+ value: value || "",
1447
+ onValueChange: handleChange,
1448
+ options,
1449
+ placeholder
1450
+ }
1451
+ ) });
1452
+ }
1453
+ const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
1454
+ return /* @__PURE__ */ jsxRuntime.jsx(
1455
+ "div",
1456
+ {
1457
+ className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
1458
+ onClick: () => setIsEditing(true),
1459
+ role: "button",
1460
+ tabIndex: 0,
1461
+ onKeyDown: (e) => {
1462
+ if (e.key === "Enter" || e.key === " ") {
1463
+ e.preventDefault();
1464
+ setIsEditing(true);
1465
+ }
1466
+ },
1467
+ children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label, value: displayValue })
1468
+ }
1469
+ );
1470
+ };
1471
+
1472
+ // src/lib/utils/alert-utils.ts
1473
+ var getTypeBadgeVariant = (type) => {
1474
+ switch (type) {
1475
+ case "Ofac":
1476
+ return "alert-ofac";
1477
+ case "Dual Approval":
1478
+ return "alert-dual";
1479
+ case "Transaction Monitoring":
1480
+ return "alert-monitoring";
1481
+ case "Transaction Processing Error":
1482
+ return "alert-error";
1483
+ default:
1484
+ return "outline";
1485
+ }
1486
+ };
1487
+ var getStatusColor = (status) => {
1488
+ switch (status) {
1489
+ case "Unassigned":
1490
+ return "text-destructive";
1491
+ case "Closed":
1492
+ return "text-success";
1493
+ case "In Progress":
1494
+ return "text-warning";
1495
+ default:
1496
+ return "";
1497
+ }
1498
+ };
1499
+
1500
+ // src/lib/constants.ts
1501
+ var COUNTRY_OPTIONS = [
1502
+ { value: "US", label: "United States" },
1503
+ { value: "CA", label: "Canada" },
1504
+ { value: "GB", label: "United Kingdom" },
1505
+ { value: "DE", label: "Germany" },
1506
+ { value: "FR", label: "France" }
1507
+ ];
1508
+ var FI_ID_TYPE_OPTIONS = [
1509
+ { value: "bic", label: "BIC" },
1510
+ { value: "swift", label: "SWIFT" },
1511
+ { value: "aba", label: "ABA" },
1512
+ { value: "iban", label: "IBAN" },
1513
+ { value: "routing", label: "Routing Number" }
1514
+ ];
1515
+ var ADDRESS_TYPE_OPTIONS = {
1516
+ FI: [
1517
+ { value: "headquarters", label: "Headquarters" },
1518
+ { value: "branch", label: "Branch Office" },
1519
+ { value: "correspondent", label: "Correspondent Bank" }
1520
+ ]
1521
+ };
1522
+ var RFI_STATUS_OPTIONS = [
1523
+ { value: "Completed", label: "Completed" },
1524
+ { value: "Provided", label: "Provided" },
1525
+ { value: "Pending", label: "Pending" }
1526
+ ];
1527
+ var ASSIGNEE_OPTIONS = [
1528
+ { value: "John Smith", label: "John Smith" },
1529
+ { value: "Sarah Johnson", label: "Sarah Johnson" },
1530
+ { value: "Michael Chen", label: "Michael Chen" },
1531
+ { value: "approverdev", label: "approverdev" },
1532
+ { value: "Unassigned", label: "Unassigned" }
1533
+ ];
1534
+ var AlertDetailView = ({
1535
+ alert,
1536
+ rfiStatus,
1537
+ assignee,
1538
+ onRfiStatusChange,
1539
+ onAssigneeChange
1540
+ }) => {
1541
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
1542
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
1543
+ /* @__PURE__ */ jsxRuntime.jsx(
1544
+ FormCard,
1545
+ {
1546
+ title: "Alert Information",
1547
+ headerActions: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }),
1548
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
1549
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Alert ID", value: alert.id }),
1550
+ /* @__PURE__ */ jsxRuntime.jsx(
1551
+ InfoField,
1552
+ {
1553
+ label: "Type",
1554
+ value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
1555
+ }
1556
+ ),
1557
+ /* @__PURE__ */ jsxRuntime.jsx(
1558
+ InfoField,
1559
+ {
1560
+ label: "Status",
1561
+ value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
1562
+ }
1563
+ ),
1564
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: alert.createdAt }),
1565
+ /* @__PURE__ */ jsxRuntime.jsx(
1566
+ InfoField,
1567
+ {
1568
+ label: "Context Type",
1569
+ value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", children: alert.contextType })
1570
+ }
1571
+ ),
1572
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
1573
+ /* @__PURE__ */ jsxRuntime.jsx(
1574
+ EditableInfoField,
1575
+ {
1576
+ label: "Assignee",
1577
+ value: assignee,
1578
+ options: ASSIGNEE_OPTIONS,
1579
+ onChange: onAssigneeChange,
1580
+ placeholder: "Unassigned"
1581
+ }
1582
+ ),
1583
+ /* @__PURE__ */ jsxRuntime.jsx(
1584
+ EditableInfoField,
1585
+ {
1586
+ label: "RFI Status",
1587
+ value: rfiStatus,
1588
+ options: RFI_STATUS_OPTIONS,
1589
+ onChange: onRfiStatusChange,
1590
+ placeholder: "Select status",
1591
+ renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", children: value })
1592
+ }
1593
+ ),
1594
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Description", value: alert.description }) })
1595
+ ] })
1596
+ }
1597
+ ),
1598
+ /* @__PURE__ */ jsxRuntime.jsx(ContextSection, { alert }),
1599
+ /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsxRuntime.jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
1600
+ /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
1601
+ ] }),
1602
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
1603
+ ] });
1604
+ };
1427
1605
 
1428
1606
  // src/assets/braid-logo.png
1429
1607
  var braid_logo_default = "./braid-logo-343BOQZ2.png";
@@ -2941,9 +3119,14 @@ var businessProfileSchema = zod.z.object({
2941
3119
  dbaName: zod.z.string().optional(),
2942
3120
  businessType: zod.z.string().min(1, "Business type is required"),
2943
3121
  taxId: zod.z.string().min(1, "Tax ID is required"),
2944
- businessPhone: zod.z.string().min(1, "Business phone is required"),
2945
- businessEmail: zod.z.string().email("Invalid email format"),
3122
+ formationDate: zod.z.string().optional(),
3123
+ idType: zod.z.string().optional(),
3124
+ incorporationState: zod.z.string().optional(),
2946
3125
  website: zod.z.string().url("Invalid URL format").optional().or(zod.z.literal("")),
3126
+ contactFirstName: zod.z.string().optional(),
3127
+ contactLastName: zod.z.string().optional(),
3128
+ contactEmail: zod.z.string().optional(),
3129
+ contactPhone: zod.z.string().optional(),
2947
3130
  address: addressSchema
2948
3131
  });
2949
3132
  zod.z.object({
@@ -3087,29 +3270,6 @@ var ACHTransferSection = ({ isEditing, onToggleEdit, className, hideActions }) =
3087
3270
  }
3088
3271
  );
3089
3272
  };
3090
-
3091
- // src/lib/constants.ts
3092
- var COUNTRY_OPTIONS = [
3093
- { value: "US", label: "United States" },
3094
- { value: "CA", label: "Canada" },
3095
- { value: "GB", label: "United Kingdom" },
3096
- { value: "DE", label: "Germany" },
3097
- { value: "FR", label: "France" }
3098
- ];
3099
- var FI_ID_TYPE_OPTIONS = [
3100
- { value: "bic", label: "BIC" },
3101
- { value: "swift", label: "SWIFT" },
3102
- { value: "aba", label: "ABA" },
3103
- { value: "iban", label: "IBAN" },
3104
- { value: "routing", label: "Routing Number" }
3105
- ];
3106
- var ADDRESS_TYPE_OPTIONS = {
3107
- FI: [
3108
- { value: "headquarters", label: "Headquarters" },
3109
- { value: "branch", label: "Branch Office" },
3110
- { value: "correspondent", label: "Correspondent Bank" }
3111
- ]
3112
- };
3113
3273
  var AddressForm = ({
3114
3274
  title,
3115
3275
  description,
@@ -3654,8 +3814,9 @@ var defaultBusinessProfile = {
3654
3814
  dbaName: "ACME Tech",
3655
3815
  businessType: "corporation",
3656
3816
  taxId: "12-3456789",
3657
- businessPhone: "+1 (555) 123-4567",
3658
- businessEmail: "contact@acme.com",
3817
+ formationDate: "2020-01-15",
3818
+ idType: "EIN",
3819
+ incorporationState: "Delaware",
3659
3820
  website: "https://acme.com",
3660
3821
  address: {
3661
3822
  streetAddress: "123 Business Avenue",
@@ -3682,75 +3843,176 @@ var BusinessProfileCard = ({
3682
3843
  onToggleEdit,
3683
3844
  onSave: onDataChange
3684
3845
  });
3685
- const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3686
- /* @__PURE__ */ jsxRuntime.jsx(
3687
- FormInput,
3688
- {
3689
- name: "legalName",
3690
- label: "Legal Name",
3691
- placeholder: "Enter legal business name",
3692
- required: true
3693
- }
3694
- ),
3695
- /* @__PURE__ */ jsxRuntime.jsx(
3696
- FormInput,
3697
- {
3698
- name: "dbaName",
3699
- label: "DBA Name",
3700
- placeholder: "Enter doing business as name"
3701
- }
3702
- ),
3703
- /* @__PURE__ */ jsxRuntime.jsx(
3704
- FormSelect,
3705
- {
3706
- name: "businessType",
3707
- label: "Business Type",
3708
- placeholder: "Select business type",
3709
- options: [
3710
- { value: "corporation", label: "Corporation" },
3711
- { value: "llc", label: "LLC" },
3712
- { value: "partnership", label: "Partnership" },
3713
- { value: "sole_proprietorship", label: "Sole Proprietorship" }
3714
- ]
3715
- }
3716
- ),
3717
- /* @__PURE__ */ jsxRuntime.jsx(
3718
- FormInput,
3719
- {
3720
- name: "taxId",
3721
- label: "Tax ID",
3722
- placeholder: "Enter tax identification number",
3723
- required: true
3724
- }
3725
- ),
3726
- /* @__PURE__ */ jsxRuntime.jsx(
3727
- FormInput,
3728
- {
3729
- name: "businessPhone",
3730
- label: "Business Phone",
3731
- placeholder: "Enter business phone number",
3732
- required: true
3733
- }
3734
- ),
3735
- /* @__PURE__ */ jsxRuntime.jsx(
3736
- FormInput,
3737
- {
3738
- name: "businessEmail",
3739
- label: "Business Email",
3740
- type: "email",
3741
- placeholder: "Enter business email",
3742
- required: true
3743
- }
3744
- ),
3745
- /* @__PURE__ */ jsxRuntime.jsx(
3746
- FormInput,
3747
- {
3748
- name: "website",
3749
- label: "Website",
3750
- placeholder: "Enter website URL"
3751
- }
3752
- )
3753
- ] }) }) });
3846
+ const editContent = /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
3847
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3848
+ /* @__PURE__ */ jsxRuntime.jsx(
3849
+ FormInput,
3850
+ {
3851
+ name: "legalName",
3852
+ label: "Legal Name",
3853
+ placeholder: "Enter legal business name",
3854
+ required: true
3855
+ }
3856
+ ),
3857
+ /* @__PURE__ */ jsxRuntime.jsx(
3858
+ FormInput,
3859
+ {
3860
+ name: "dbaName",
3861
+ label: "DBA Name",
3862
+ placeholder: "Enter doing business as name"
3863
+ }
3864
+ ),
3865
+ /* @__PURE__ */ jsxRuntime.jsx(
3866
+ FormSelect,
3867
+ {
3868
+ name: "businessType",
3869
+ label: "Business Type",
3870
+ placeholder: "Select business type",
3871
+ options: [
3872
+ { value: "corporation", label: "Corporation" },
3873
+ { value: "llc", label: "LLC" },
3874
+ { value: "partnership", label: "Partnership" },
3875
+ { value: "sole_proprietorship", label: "Sole Proprietorship" }
3876
+ ]
3877
+ }
3878
+ ),
3879
+ /* @__PURE__ */ jsxRuntime.jsx(
3880
+ FormInput,
3881
+ {
3882
+ name: "taxId",
3883
+ label: "Tax ID",
3884
+ placeholder: "Enter tax identification number",
3885
+ required: true
3886
+ }
3887
+ ),
3888
+ /* @__PURE__ */ jsxRuntime.jsx(
3889
+ FormInput,
3890
+ {
3891
+ name: "formationDate",
3892
+ label: "Formation Date",
3893
+ type: "date",
3894
+ placeholder: "Enter formation date"
3895
+ }
3896
+ ),
3897
+ /* @__PURE__ */ jsxRuntime.jsx(
3898
+ FormSelect,
3899
+ {
3900
+ name: "idType",
3901
+ label: "ID Type",
3902
+ placeholder: "Select ID type",
3903
+ options: [
3904
+ { value: "ein", label: "EIN" },
3905
+ { value: "ssn", label: "SSN" },
3906
+ { value: "itin", label: "ITIN" }
3907
+ ]
3908
+ }
3909
+ ),
3910
+ /* @__PURE__ */ jsxRuntime.jsx(
3911
+ FormInput,
3912
+ {
3913
+ name: "incorporationState",
3914
+ label: "Incorporation State",
3915
+ placeholder: "Enter incorporation state"
3916
+ }
3917
+ ),
3918
+ /* @__PURE__ */ jsxRuntime.jsx(
3919
+ FormInput,
3920
+ {
3921
+ name: "website",
3922
+ label: "Website",
3923
+ placeholder: "Enter website URL"
3924
+ }
3925
+ )
3926
+ ] }),
3927
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
3928
+ /* @__PURE__ */ jsxRuntime.jsx(
3929
+ FormInput,
3930
+ {
3931
+ name: "address.streetAddress",
3932
+ label: "Street Address",
3933
+ placeholder: "Enter street address"
3934
+ }
3935
+ ),
3936
+ /* @__PURE__ */ jsxRuntime.jsx(
3937
+ FormInput,
3938
+ {
3939
+ name: "address.apartment",
3940
+ label: "Apartment, suite, or floor",
3941
+ placeholder: "Enter apartment, suite, or floor"
3942
+ }
3943
+ )
3944
+ ] }),
3945
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3946
+ /* @__PURE__ */ jsxRuntime.jsx(
3947
+ FormInput,
3948
+ {
3949
+ name: "address.city",
3950
+ label: "City",
3951
+ placeholder: "Enter city"
3952
+ }
3953
+ ),
3954
+ /* @__PURE__ */ jsxRuntime.jsx(
3955
+ FormInput,
3956
+ {
3957
+ name: "address.state",
3958
+ label: "State",
3959
+ placeholder: "Enter state"
3960
+ }
3961
+ ),
3962
+ /* @__PURE__ */ jsxRuntime.jsx(
3963
+ FormInput,
3964
+ {
3965
+ name: "address.postalCode",
3966
+ label: "Postal Code",
3967
+ placeholder: "Enter postal code"
3968
+ }
3969
+ ),
3970
+ /* @__PURE__ */ jsxRuntime.jsx(
3971
+ FormInput,
3972
+ {
3973
+ name: "address.country",
3974
+ label: "Country Code",
3975
+ placeholder: "Enter country code"
3976
+ }
3977
+ )
3978
+ ] }),
3979
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
3980
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
3981
+ /* @__PURE__ */ jsxRuntime.jsx(
3982
+ FormInput,
3983
+ {
3984
+ name: "contactFirstName",
3985
+ label: "First Name",
3986
+ placeholder: "Enter first name"
3987
+ }
3988
+ ),
3989
+ /* @__PURE__ */ jsxRuntime.jsx(
3990
+ FormInput,
3991
+ {
3992
+ name: "contactLastName",
3993
+ label: "Last Name",
3994
+ placeholder: "Enter last name"
3995
+ }
3996
+ ),
3997
+ /* @__PURE__ */ jsxRuntime.jsx(
3998
+ FormInput,
3999
+ {
4000
+ name: "contactEmail",
4001
+ label: "Email",
4002
+ type: "email",
4003
+ placeholder: "Enter email"
4004
+ }
4005
+ ),
4006
+ /* @__PURE__ */ jsxRuntime.jsx(
4007
+ FormInput,
4008
+ {
4009
+ name: "contactPhone",
4010
+ label: "Phone Number",
4011
+ placeholder: "Enter phone number"
4012
+ }
4013
+ )
4014
+ ] })
4015
+ ] }) });
3754
4016
  const formValues = form.watch();
3755
4017
  const viewContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3756
4018
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
@@ -3762,10 +4024,30 @@ var BusinessProfileCard = ({
3762
4024
  /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Tax ID", value: formValues?.taxId, layout: "horizontal" })
3763
4025
  ] }),
3764
4026
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3765
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Business Phone", value: formValues?.businessPhone, layout: "horizontal" }),
3766
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Business Email", value: formValues?.businessEmail, layout: "horizontal" })
4027
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Formation Date", value: formValues?.formationDate || "2020-01-15", layout: "horizontal" }),
4028
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "ID Type", value: formValues?.idType || "EIN", layout: "horizontal" })
4029
+ ] }),
4030
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4031
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Incorporation State", value: formValues?.incorporationState || "Delaware", layout: "horizontal" }),
4032
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Website", value: formValues?.website, layout: "horizontal" })
4033
+ ] }),
4034
+ /* @__PURE__ */ jsxRuntime.jsx(
4035
+ InfoField,
4036
+ {
4037
+ label: "Address",
4038
+ value: formValues?.address ? `${formValues.address.streetAddress}${formValues.address.apartment ? ", " + formValues.address.apartment : ""}, ${formValues.address.city}, ${formValues.address.state} ${formValues.address.postalCode}, ${formValues.address.country}` : "123 Business Avenue, Suite 100, New York, NY 10001, US",
4039
+ layout: "horizontal"
4040
+ }
4041
+ ),
4042
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Contact Person" }),
4043
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4044
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "First Name", value: formValues?.contactFirstName || "John", layout: "horizontal" }),
4045
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last Name", value: formValues?.contactLastName || "Smith", layout: "horizontal" })
3767
4046
  ] }),
3768
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Website", value: formValues?.website, layout: "horizontal" }) })
4047
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4048
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Email", value: formValues?.contactEmail || "john.smith@acme.com", layout: "horizontal" }),
4049
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: formValues?.contactPhone || "+1 (555) 123-4567", layout: "horizontal" })
4050
+ ] })
3769
4051
  ] });
3770
4052
  return /* @__PURE__ */ jsxRuntime.jsx(
3771
4053
  EditableFormCard,
@@ -3783,30 +4065,75 @@ var BusinessProfileCard = ({
3783
4065
  }
3784
4066
  );
3785
4067
  };
4068
+ var mockBusinessTimeline = [
4069
+ {
4070
+ id: "1",
4071
+ action: "Business Created",
4072
+ user: "admin",
4073
+ details: "Initial business setup",
4074
+ status: "Active",
4075
+ timestamp: "2025-08-03 10:30:00"
4076
+ },
4077
+ {
4078
+ id: "2",
4079
+ action: "Profile Updated",
4080
+ user: "admin",
4081
+ details: "Updated business information",
4082
+ timestamp: "2025-09-05 14:22:00"
4083
+ },
4084
+ {
4085
+ id: "3",
4086
+ action: "OFAC Check Completed",
4087
+ user: "System",
4088
+ details: "Automated compliance check",
4089
+ status: "Verified",
4090
+ timestamp: "2025-09-05 14:30:00"
4091
+ }
4092
+ ];
3786
4093
  var BusinessStatusCard = ({ isEditing, onToggleEdit, className }) => {
4094
+ const getIcon = (action) => {
4095
+ if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
4096
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
4097
+ if (action.includes("Updated") || action.includes("Modified") || action.includes("Check")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
4098
+ if (action.includes("Completed") || action.includes("Verified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
4099
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
4100
+ };
4101
+ const getStatusColor2 = (status) => {
4102
+ switch (status) {
4103
+ case "Active":
4104
+ case "Verified":
4105
+ return "text-success";
4106
+ case "Pending":
4107
+ return "text-warning";
4108
+ default:
4109
+ return "text-muted-foreground";
4110
+ }
4111
+ };
3787
4112
  return /* @__PURE__ */ jsxRuntime.jsx(
3788
4113
  FormCard,
3789
4114
  {
3790
- title: "Business Status & Records",
4115
+ title: "Timeline",
3791
4116
  className,
3792
- headerActions: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3793
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", size: "sm", onClick: onToggleEdit, children: "Cancel" }),
3794
- /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: onToggleEdit, children: "Save" })
3795
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "icon", onClick: onToggleEdit, className: "text-primary hover:text-primary/80 hover:bg-primary/10", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }) }),
3796
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
3797
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3798
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Status", value: /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: "ACTIVE" }), layout: "horizontal" }),
3799
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "CIP Status", value: "NOT_START", layout: "horizontal" })
3800
- ] }),
3801
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3802
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created Date", value: "2025-08-03", layout: "horizontal" }),
3803
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Updated Date", value: "2025-09-05", layout: "horizontal" })
3804
- ] }),
3805
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3806
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC Date", value: "2025-09-05", layout: "horizontal" }),
3807
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Last OFAC Status", value: "View Status", layout: "horizontal", className: "text-primary cursor-pointer" })
4117
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: mockBusinessTimeline.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
4118
+ index !== mockBusinessTimeline.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
4119
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
4120
+ "absolute left-0 top-0 flex-none",
4121
+ getStatusColor2(event.status)
4122
+ ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
4123
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
4124
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
4125
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
4126
+ "by ",
4127
+ event.user
4128
+ ] }),
4129
+ event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
4130
+ event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
4131
+ "Status: ",
4132
+ event.status
4133
+ ] }),
4134
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
3808
4135
  ] })
3809
- ] })
4136
+ ] }, event.id)) })
3810
4137
  }
3811
4138
  );
3812
4139
  };
@@ -3831,18 +4158,27 @@ var ContactInfoCard = ({ isEditing, onToggleEdit, className }) => {
3831
4158
  /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Phone Number", value: "", layout: "horizontal" })
3832
4159
  ] }),
3833
4160
  /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-sm font-medium text-muted-foreground mt-6", children: "Mailing Address" }),
3834
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
3835
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
3836
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
3837
- ] }),
3838
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3839
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
3840
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
3841
- ] }),
3842
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
3843
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
3844
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
3845
- ] })
4161
+ isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4162
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
4163
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Street Address", value: "", layout: "horizontal" }),
4164
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Apartment, suite, or floor", value: "", layout: "horizontal" })
4165
+ ] }),
4166
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4167
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "City", value: "", layout: "horizontal" }),
4168
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "State", value: "Alabama", layout: "horizontal" })
4169
+ ] }),
4170
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
4171
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Postal Code", value: "", layout: "horizontal" }),
4172
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Country Code", value: "US", layout: "horizontal" })
4173
+ ] })
4174
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(
4175
+ InfoField,
4176
+ {
4177
+ label: "Address",
4178
+ value: "123 Business Avenue, Suite 100, New York, NY 10001, US",
4179
+ layout: "horizontal"
4180
+ }
4181
+ )
3846
4182
  ] })
3847
4183
  }
3848
4184
  );
@@ -4631,6 +4967,75 @@ var ListPage = React13__namespace.forwardRef(
4631
4967
  }
4632
4968
  );
4633
4969
  ListPage.displayName = "ListPage";
4970
+ var StatementHeader = ({ data, onEdit }) => {
4971
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4972
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
4973
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Summary" }),
4974
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
4975
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-2" }),
4976
+ "Edit"
4977
+ ] })
4978
+ ] }),
4979
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
4980
+ /* @__PURE__ */ jsxRuntime.jsx(
4981
+ InfoField,
4982
+ {
4983
+ label: "Account",
4984
+ value: data.account,
4985
+ layout: "horizontal"
4986
+ }
4987
+ ),
4988
+ /* @__PURE__ */ jsxRuntime.jsx(
4989
+ InfoField,
4990
+ {
4991
+ label: "Product ID",
4992
+ value: data.productId,
4993
+ layout: "horizontal"
4994
+ }
4995
+ ),
4996
+ /* @__PURE__ */ jsxRuntime.jsx(
4997
+ InfoField,
4998
+ {
4999
+ label: "Program ID",
5000
+ value: data.programId,
5001
+ layout: "horizontal"
5002
+ }
5003
+ ),
5004
+ /* @__PURE__ */ jsxRuntime.jsx(
5005
+ InfoField,
5006
+ {
5007
+ label: "Start Date",
5008
+ value: data.startDate,
5009
+ layout: "horizontal"
5010
+ }
5011
+ ),
5012
+ /* @__PURE__ */ jsxRuntime.jsx(
5013
+ InfoField,
5014
+ {
5015
+ label: "End Date",
5016
+ value: data.endDate,
5017
+ layout: "horizontal"
5018
+ }
5019
+ ),
5020
+ /* @__PURE__ */ jsxRuntime.jsx(
5021
+ InfoField,
5022
+ {
5023
+ label: "Starting Balance",
5024
+ value: data.startingBalance,
5025
+ layout: "horizontal"
5026
+ }
5027
+ ),
5028
+ /* @__PURE__ */ jsxRuntime.jsx(
5029
+ InfoField,
5030
+ {
5031
+ label: "Ending Balance",
5032
+ value: data.endingBalance,
5033
+ layout: "horizontal"
5034
+ }
5035
+ )
5036
+ ] }) })
5037
+ ] });
5038
+ };
4634
5039
  var ACHDetailsSection = ({ data }) => {
4635
5040
  const formatCurrency = (value) => {
4636
5041
  return new Intl.NumberFormat("en-US", {
@@ -4871,6 +5276,7 @@ function DataTable({
4871
5276
  sortBy,
4872
5277
  sortDirection,
4873
5278
  onSort,
5279
+ onRowClick,
4874
5280
  loading = false,
4875
5281
  emptyMessage = "No data available",
4876
5282
  className
@@ -4908,7 +5314,7 @@ function DataTable({
4908
5314
  "th",
4909
5315
  {
4910
5316
  className: cn(
4911
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground",
5317
+ "px-3 py-2 text-left align-middle text-sm font-medium bg-muted/50",
4912
5318
  column.align === "center" && "text-center",
4913
5319
  column.align === "right" && "text-right",
4914
5320
  column.width && `w-[${column.width}]`
@@ -4918,7 +5324,7 @@ function DataTable({
4918
5324
  {
4919
5325
  variant: "ghost",
4920
5326
  size: "sm",
4921
- className: "h-auto p-0 font-medium hover:bg-transparent",
5327
+ className: "h-auto p-0 text-sm font-medium hover:bg-transparent",
4922
5328
  onClick: () => handleSort(column.key),
4923
5329
  children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center", children: [
4924
5330
  column.title,
@@ -4932,12 +5338,16 @@ function DataTable({
4932
5338
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns.length, className: "h-24 text-center text-muted-foreground", children: emptyMessage }) }) : data.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
4933
5339
  "tr",
4934
5340
  {
4935
- className: "border-b transition-colors hover:bg-muted/50",
5341
+ className: cn(
5342
+ "border-b transition-colors hover:bg-muted/50",
5343
+ onRowClick && "cursor-pointer"
5344
+ ),
5345
+ onClick: () => onRowClick?.(row),
4936
5346
  children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx(
4937
5347
  "td",
4938
5348
  {
4939
5349
  className: cn(
4940
- "p-4 align-middle",
5350
+ "px-3 py-2 align-middle text-sm",
4941
5351
  column.align === "center" && "text-center",
4942
5352
  column.align === "right" && "text-right"
4943
5353
  ),
@@ -5170,50 +5580,6 @@ var DropdownMenuSeparator = React13__namespace.forwardRef(({ className, ...props
5170
5580
  }
5171
5581
  ));
5172
5582
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
5173
- var EditableInfoField = ({
5174
- label,
5175
- value,
5176
- options,
5177
- onChange,
5178
- placeholder = "Select...",
5179
- renderValue,
5180
- className
5181
- }) => {
5182
- const [isEditing, setIsEditing] = React13.useState(false);
5183
- const handleChange = (newValue) => {
5184
- onChange(newValue);
5185
- setIsEditing(false);
5186
- };
5187
- if (isEditing) {
5188
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
5189
- EnhancedSelect,
5190
- {
5191
- label,
5192
- value: value || "",
5193
- onValueChange: handleChange,
5194
- options,
5195
- placeholder
5196
- }
5197
- ) });
5198
- }
5199
- const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
5200
- return /* @__PURE__ */ jsxRuntime.jsx(
5201
- "div",
5202
- {
5203
- className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
5204
- onClick: () => setIsEditing(true),
5205
- role: "button",
5206
- tabIndex: 0,
5207
- onKeyDown: (e) => {
5208
- if (e.key === "Enter" || e.key === " ") {
5209
- e.preventDefault();
5210
- setIsEditing(true);
5211
- }
5212
- },
5213
- children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label, value: displayValue })
5214
- }
5215
- );
5216
- };
5217
5583
  var EntityCard = React13__namespace.forwardRef(
5218
5584
  ({
5219
5585
  entity,
@@ -6335,22 +6701,10 @@ var mockAlerts = [
6335
6701
  description: "Transaction WIRE_DOMESTIC_CREDIT of $30,000.00 is flagged for velocity limit ..."
6336
6702
  }
6337
6703
  ];
6338
- var RFI_STATUS_OPTIONS = [
6339
- { value: "Completed", label: "Completed" },
6340
- { value: "Provided", label: "Provided" },
6341
- { value: "Pending", label: "Pending" }
6342
- ];
6343
- var ASSIGNEE_OPTIONS = [
6344
- { value: "John Smith", label: "John Smith" },
6345
- { value: "Sarah Johnson", label: "Sarah Johnson" },
6346
- { value: "Michael Chen", label: "Michael Chen" },
6347
- { value: "approverdev", label: "approverdev" },
6348
- { value: "Unassigned", label: "Unassigned" }
6349
- ];
6350
- var AlertDetail = () => {
6351
- const { id } = reactRouterDom.useParams();
6352
- const navigate = reactRouterDom.useNavigate();
6353
- const alert = mockAlerts.find((a) => a.id === id);
6704
+
6705
+ // src/hooks/useAlertDetail.ts
6706
+ var useAlertDetail = (id) => {
6707
+ const alert = React13.useMemo(() => mockAlerts.find((a) => a.id === id), [id]);
6354
6708
  const [rfiStatus, setRfiStatus] = React13.useState(alert?.rfiStatus || "");
6355
6709
  const [assignee, setAssignee] = React13.useState(alert?.assignee || "Unassigned");
6356
6710
  const handleRfiStatusChange = (newStatus) => {
@@ -6361,6 +6715,26 @@ var AlertDetail = () => {
6361
6715
  setAssignee(newAssignee);
6362
6716
  console.log("Assignee updated to:", newAssignee);
6363
6717
  };
6718
+ return {
6719
+ alert,
6720
+ isLoading: false,
6721
+ // Set to true when implementing real data fetching
6722
+ rfiStatus,
6723
+ assignee,
6724
+ handleRfiStatusChange,
6725
+ handleAssigneeChange
6726
+ };
6727
+ };
6728
+ var AlertDetail = () => {
6729
+ const { id } = reactRouterDom.useParams();
6730
+ const navigate = reactRouterDom.useNavigate();
6731
+ const {
6732
+ alert,
6733
+ rfiStatus,
6734
+ assignee,
6735
+ handleRfiStatusChange,
6736
+ handleAssigneeChange
6737
+ } = useAlertDetail(id);
6364
6738
  if (!alert) {
6365
6739
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
6366
6740
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold mb-2", children: "Alert Not Found" }),
@@ -6372,32 +6746,6 @@ var AlertDetail = () => {
6372
6746
  /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => navigate("/alerts"), children: "Back to Alerts" })
6373
6747
  ] }) });
6374
6748
  }
6375
- const getTypeBadgeVariant = (type) => {
6376
- switch (type) {
6377
- case "Ofac":
6378
- return "alert-ofac";
6379
- case "Dual Approval":
6380
- return "alert-dual";
6381
- case "Transaction Monitoring":
6382
- return "alert-monitoring";
6383
- case "Transaction Processing Error":
6384
- return "alert-error";
6385
- default:
6386
- return "outline";
6387
- }
6388
- };
6389
- const getStatusColor = (status) => {
6390
- switch (status) {
6391
- case "Unassigned":
6392
- return "text-destructive";
6393
- case "Closed":
6394
- return "text-success";
6395
- case "In Progress":
6396
- return "text-warning";
6397
- default:
6398
- return "";
6399
- }
6400
- };
6401
6749
  return /* @__PURE__ */ jsxRuntime.jsx(
6402
6750
  PageLayout,
6403
6751
  {
@@ -6421,69 +6769,16 @@ var AlertDetail = () => {
6421
6769
  onClick: () => console.log("Close alert")
6422
6770
  }
6423
6771
  ],
6424
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
6425
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
6426
- /* @__PURE__ */ jsxRuntime.jsx(
6427
- FormCard,
6428
- {
6429
- title: "Alert Information",
6430
- headerActions: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }),
6431
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6432
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Alert ID", value: alert.id }),
6433
- /* @__PURE__ */ jsxRuntime.jsx(
6434
- InfoField,
6435
- {
6436
- label: "Type",
6437
- value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
6438
- }
6439
- ),
6440
- /* @__PURE__ */ jsxRuntime.jsx(
6441
- InfoField,
6442
- {
6443
- label: "Status",
6444
- value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
6445
- }
6446
- ),
6447
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: alert.createdAt }),
6448
- /* @__PURE__ */ jsxRuntime.jsx(
6449
- InfoField,
6450
- {
6451
- label: "Context Type",
6452
- value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", children: alert.contextType })
6453
- }
6454
- ),
6455
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
6456
- /* @__PURE__ */ jsxRuntime.jsx(
6457
- EditableInfoField,
6458
- {
6459
- label: "Assignee",
6460
- value: assignee,
6461
- options: ASSIGNEE_OPTIONS,
6462
- onChange: handleAssigneeChange,
6463
- placeholder: "Unassigned"
6464
- }
6465
- ),
6466
- /* @__PURE__ */ jsxRuntime.jsx(
6467
- EditableInfoField,
6468
- {
6469
- label: "RFI Status",
6470
- value: rfiStatus,
6471
- options: RFI_STATUS_OPTIONS,
6472
- onChange: handleRfiStatusChange,
6473
- placeholder: "Select status",
6474
- renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", children: value })
6475
- }
6476
- ),
6477
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Description", value: alert.description }) })
6478
- ] })
6479
- }
6480
- ),
6481
- /* @__PURE__ */ jsxRuntime.jsx(ContextSection, { alert }),
6482
- /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsxRuntime.jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
6483
- /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
6484
- ] }),
6485
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
6486
- ] })
6772
+ children: /* @__PURE__ */ jsxRuntime.jsx(
6773
+ AlertDetailView,
6774
+ {
6775
+ alert,
6776
+ rfiStatus,
6777
+ assignee,
6778
+ onRfiStatusChange: handleRfiStatusChange,
6779
+ onAssigneeChange: handleAssigneeChange
6780
+ }
6781
+ )
6487
6782
  }
6488
6783
  );
6489
6784
  };
@@ -6542,7 +6837,7 @@ var Alerts = () => {
6542
6837
  setFilteredAlerts(mockAlerts);
6543
6838
  setCurrentPage(1);
6544
6839
  };
6545
- const getTypeBadgeVariant = (type) => {
6840
+ const getTypeBadgeVariant2 = (type) => {
6546
6841
  switch (type) {
6547
6842
  case "Ofac":
6548
6843
  return "alert-ofac";
@@ -6556,7 +6851,7 @@ var Alerts = () => {
6556
6851
  return "outline";
6557
6852
  }
6558
6853
  };
6559
- const getStatusColor = (status) => {
6854
+ const getStatusColor2 = (status) => {
6560
6855
  switch (status) {
6561
6856
  case "Unassigned":
6562
6857
  return "text-destructive";
@@ -6697,146 +6992,573 @@ var Alerts = () => {
6697
6992
  }
6698
6993
  )
6699
6994
  ] })
6700
- ] }),
6701
- /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
6702
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
6703
- /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
6995
+ ] }),
6996
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
6997
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
6998
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
6999
+ ] })
7000
+ ] })
7001
+ ] })
7002
+ ] }) }) }),
7003
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 mt-4 rounded-lg border bg-card overflow-hidden flex flex-col", children: [
7004
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full table-fixed", children: [
7005
+ /* @__PURE__ */ jsxRuntime.jsxs("colgroup", { children: [
7006
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-28" }),
7007
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-36" }),
7008
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-52" }),
7009
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-32" }),
7010
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-36" }),
7011
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-32" }),
7012
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-auto" })
7013
+ ] }),
7014
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "sticky top-0 bg-card z-10 shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b", children: [
7015
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Alert ID" }),
7016
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Created At" }),
7017
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Type" }),
7018
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Status" }),
7019
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Context Type" }),
7020
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "RFI Status" }),
7021
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Description" })
7022
+ ] }) }),
7023
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedAlerts.map((alert) => /* @__PURE__ */ jsxRuntime.jsxs(
7024
+ "tr",
7025
+ {
7026
+ className: "border-b hover:bg-muted/50 transition-colors cursor-pointer",
7027
+ onClick: () => navigate(`/alerts/${alert.id}`),
7028
+ children: [
7029
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: alert.id }),
7030
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: alert.createdAt }),
7031
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant2(alert.type), className: "whitespace-nowrap", children: alert.type }) }),
7032
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs font-medium", getStatusColor2(alert.status)), children: alert.status }) }),
7033
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "whitespace-nowrap", children: alert.contextType }) }),
7034
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: alert.rfiStatus && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", className: "whitespace-nowrap", children: alert.rfiStatus }) }),
7035
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs truncate", children: alert.description })
7036
+ ]
7037
+ },
7038
+ alert.id
7039
+ )) })
7040
+ ] }) }),
7041
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-t bg-background py-3 px-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
7042
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7043
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Rows per page:" }),
7044
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
7045
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1", children: [
7046
+ rowsPerPage,
7047
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 rotate-90" })
7048
+ ] }) }),
7049
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "start", className: "bg-background z-50", children: [
7050
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(100), children: "100" }),
7051
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(200), children: "200" }),
7052
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(500), children: "500" })
7053
+ ] })
7054
+ ] })
7055
+ ] }),
7056
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
7057
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground", children: [
7058
+ "Page ",
7059
+ currentPage,
7060
+ " of ",
7061
+ totalPages
7062
+ ] }),
7063
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
7064
+ /* @__PURE__ */ jsxRuntime.jsx(
7065
+ Button,
7066
+ {
7067
+ variant: "outline",
7068
+ size: "sm",
7069
+ className: "h-8 w-8 p-0",
7070
+ onClick: () => handlePageChange(currentPage - 1),
7071
+ disabled: currentPage === 1,
7072
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
7073
+ }
7074
+ ),
7075
+ /* @__PURE__ */ jsxRuntime.jsx(
7076
+ Button,
7077
+ {
7078
+ variant: "outline",
7079
+ size: "sm",
7080
+ className: "h-8 w-8 p-0",
7081
+ onClick: () => handlePageChange(currentPage + 1),
7082
+ disabled: currentPage === totalPages,
7083
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
7084
+ }
7085
+ )
7086
+ ] })
7087
+ ] })
7088
+ ] }) })
7089
+ ] }) }) })
7090
+ ] });
7091
+ };
7092
+ var Alerts_default = Alerts;
7093
+
7094
+ // src/lib/mock-data/businesses-list-data.ts
7095
+ var mockBusinessesList = [
7096
+ {
7097
+ id: "8112488",
7098
+ businessName: "RAPIDZ PAY INC",
7099
+ productName: "Fiat Republic Canada Inc. FBO Rapidz Pay",
7100
+ cipStatus: "verified",
7101
+ status: "active",
7102
+ created: "2025-10-05",
7103
+ modified: "2025-10-05"
7104
+ },
7105
+ {
7106
+ id: "8111609",
7107
+ businessName: "Fern Hyper Growth Llc",
7108
+ productName: "Atomic Brokerage FBO Atomic Brokerage Clients",
7109
+ cipStatus: "verified",
7110
+ status: "active",
7111
+ created: "2025-10-04",
7112
+ modified: "2025-10-04"
7113
+ },
7114
+ {
7115
+ id: "8111026",
7116
+ businessName: "ACEROSGALVANISADOS & PREPINTADOS",
7117
+ productName: "SendFriend Inc FBO Conduit Pay Agent",
7118
+ cipStatus: "not_start",
7119
+ status: "active",
7120
+ created: "2025-10-03",
7121
+ modified: "2025-10-03"
7122
+ },
7123
+ {
7124
+ id: "8110892",
7125
+ businessName: "Tech Solutions Corp",
7126
+ productName: "Digital Finance Inc FBO Tech Solutions",
7127
+ cipStatus: "pending",
7128
+ status: "active",
7129
+ created: "2025-10-02",
7130
+ modified: "2025-10-02"
7131
+ },
7132
+ {
7133
+ id: "8110654",
7134
+ businessName: "Global Trade Partners LLC",
7135
+ productName: "Swift Transfer FBO Global Trade",
7136
+ cipStatus: "verified",
7137
+ status: "active",
7138
+ created: "2025-10-01",
7139
+ modified: "2025-10-01"
7140
+ }
7141
+ ];
7142
+ var Businesses = () => {
7143
+ const navigate = reactRouterDom.useNavigate();
7144
+ const [businesses, setBusinesses] = React13.useState(mockBusinessesList);
7145
+ const [filteredBusinesses, setFilteredBusinesses] = React13.useState(mockBusinessesList);
7146
+ const [sortBy, setSortBy] = React13.useState("created");
7147
+ const [sortDirection, setSortDirection] = React13.useState("desc");
7148
+ const [filters, setFilters] = React13.useState({
7149
+ name: "",
7150
+ productName: "",
7151
+ status: "",
7152
+ createdDateStart: void 0,
7153
+ createdDateEnd: void 0
7154
+ });
7155
+ const handleFilterChange = (field, value) => {
7156
+ setFilters((prev) => ({ ...prev, [field]: value }));
7157
+ };
7158
+ const applyFilters = () => {
7159
+ let filtered = businesses;
7160
+ if (filters.name) {
7161
+ filtered = filtered.filter(
7162
+ (business) => business.businessName.toLowerCase().includes(filters.name.toLowerCase())
7163
+ );
7164
+ }
7165
+ if (filters.productName) {
7166
+ filtered = filtered.filter(
7167
+ (business) => business.productName.toLowerCase().includes(filters.productName.toLowerCase())
7168
+ );
7169
+ }
7170
+ if (filters.status) {
7171
+ filtered = filtered.filter((business) => business.status === filters.status);
7172
+ }
7173
+ if (filters.createdDateStart) {
7174
+ filtered = filtered.filter(
7175
+ (business) => new Date(business.created) >= filters.createdDateStart
7176
+ );
7177
+ }
7178
+ if (filters.createdDateEnd) {
7179
+ filtered = filtered.filter(
7180
+ (business) => new Date(business.created) <= filters.createdDateEnd
7181
+ );
7182
+ }
7183
+ setFilteredBusinesses(filtered);
7184
+ };
7185
+ const resetFilters = () => {
7186
+ setFilters({
7187
+ name: "",
7188
+ productName: "",
7189
+ status: "",
7190
+ createdDateStart: void 0,
7191
+ createdDateEnd: void 0
7192
+ });
7193
+ setFilteredBusinesses(businesses);
7194
+ };
7195
+ const handleSort = (key) => {
7196
+ if (sortBy === key) {
7197
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
7198
+ } else {
7199
+ setSortBy(key);
7200
+ setSortDirection("asc");
7201
+ }
7202
+ };
7203
+ const handleRowClick = (business) => {
7204
+ navigate(`/business/${business.id}`);
7205
+ };
7206
+ const columns = [
7207
+ {
7208
+ key: "id",
7209
+ title: "Business ID",
7210
+ sortable: true
7211
+ },
7212
+ {
7213
+ key: "businessName",
7214
+ title: "Business Name",
7215
+ sortable: true
7216
+ },
7217
+ {
7218
+ key: "productName",
7219
+ title: "Product Name",
7220
+ sortable: true,
7221
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary hover:underline cursor-pointer", children: value })
7222
+ },
7223
+ {
7224
+ key: "cipStatus",
7225
+ title: "CIP status",
7226
+ sortable: true,
7227
+ render: (value) => {
7228
+ const status = value;
7229
+ const variant = status === "verified" ? "success" : status === "pending" ? "warning" : "default";
7230
+ const label = status === "verified" ? "Verified" : status === "pending" ? "Pending" : "Not Start";
7231
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, children: label });
7232
+ }
7233
+ },
7234
+ {
7235
+ key: "status",
7236
+ title: "Status",
7237
+ sortable: true,
7238
+ render: (value) => {
7239
+ const status = value;
7240
+ const variant = status === "active" ? "success" : "default";
7241
+ const label = status.charAt(0).toUpperCase() + status.slice(1);
7242
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant, children: label });
7243
+ }
7244
+ },
7245
+ {
7246
+ key: "created",
7247
+ title: "Created",
7248
+ sortable: true
7249
+ },
7250
+ {
7251
+ key: "modified",
7252
+ title: "Modified",
7253
+ sortable: true
7254
+ }
7255
+ ];
7256
+ const sortedBusinesses = [...filteredBusinesses].sort((a, b) => {
7257
+ const aValue = a[sortBy];
7258
+ const bValue = b[sortBy];
7259
+ if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
7260
+ if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
7261
+ return 0;
7262
+ });
7263
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-screen bg-gradient-subtle", children: [
7264
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 py-4 max-w-none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
7265
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
7266
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold text-foreground", children: "Businesses" }),
7267
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children: "Manage business entities and their configurations" })
7268
+ ] }),
7269
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7270
+ /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { children: [
7271
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", className: "gap-2", children: [
7272
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Filter, { className: "h-4 w-4" }),
7273
+ "Filters"
7274
+ ] }) }),
7275
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetContent, { side: "right", className: "w-full sm:max-w-xl overflow-y-auto", children: [
7276
+ /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Business Filters" }) }),
7277
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6 py-6", children: [
7278
+ /* @__PURE__ */ jsxRuntime.jsx(
7279
+ EnhancedInput,
7280
+ {
7281
+ label: "Name",
7282
+ value: filters.name,
7283
+ onChange: (e) => handleFilterChange("name", e.target.value),
7284
+ placeholder: "Enter business name"
7285
+ }
7286
+ ),
7287
+ /* @__PURE__ */ jsxRuntime.jsx(
7288
+ EnhancedInput,
7289
+ {
7290
+ label: "Product Name",
7291
+ value: filters.productName,
7292
+ onChange: (e) => handleFilterChange("productName", e.target.value),
7293
+ placeholder: "Enter product name"
7294
+ }
7295
+ ),
7296
+ /* @__PURE__ */ jsxRuntime.jsx(
7297
+ EnhancedSelect,
7298
+ {
7299
+ label: "Status",
7300
+ value: filters.status,
7301
+ onValueChange: (value) => handleFilterChange("status", value),
7302
+ placeholder: "Select status",
7303
+ options: [
7304
+ { value: "active", label: "Active" },
7305
+ { value: "inactive", label: "Inactive" },
7306
+ { value: "suspended", label: "Suspended" }
7307
+ ]
7308
+ }
7309
+ ),
7310
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
7311
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
7312
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date Start" }),
7313
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
7314
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
7315
+ Button,
7316
+ {
7317
+ variant: "outline",
7318
+ className: cn(
7319
+ "w-full justify-start text-left font-normal",
7320
+ !filters.createdDateStart && "text-muted-foreground"
7321
+ ),
7322
+ children: [
7323
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "mr-2 h-4 w-4" }),
7324
+ filters.createdDateStart ? dateFns.format(filters.createdDateStart, "MM/dd/yyyy") : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "MM/DD/YYYY" })
7325
+ ]
7326
+ }
7327
+ ) }),
7328
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 bg-background z-50", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
7329
+ Calendar,
7330
+ {
7331
+ mode: "single",
7332
+ selected: filters.createdDateStart,
7333
+ onSelect: (date) => handleFilterChange("createdDateStart", date),
7334
+ initialFocus: true,
7335
+ className: "pointer-events-auto"
7336
+ }
7337
+ ) })
7338
+ ] })
7339
+ ] }),
7340
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
7341
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Created Date End" }),
7342
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
7343
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
7344
+ Button,
7345
+ {
7346
+ variant: "outline",
7347
+ className: cn(
7348
+ "w-full justify-start text-left font-normal",
7349
+ !filters.createdDateEnd && "text-muted-foreground"
7350
+ ),
7351
+ children: [
7352
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "mr-2 h-4 w-4" }),
7353
+ filters.createdDateEnd ? dateFns.format(filters.createdDateEnd, "MM/dd/yyyy") : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "MM/DD/YYYY" })
7354
+ ]
7355
+ }
7356
+ ) }),
7357
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 bg-background z-50", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
7358
+ Calendar,
7359
+ {
7360
+ mode: "single",
7361
+ selected: filters.createdDateEnd,
7362
+ onSelect: (date) => handleFilterChange("createdDateEnd", date),
7363
+ initialFocus: true,
7364
+ className: "pointer-events-auto"
7365
+ }
7366
+ ) })
7367
+ ] })
7368
+ ] })
7369
+ ] })
7370
+ ] }),
7371
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { className: "gap-2", children: [
7372
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: resetFilters, children: "Reset Filters" }),
7373
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: applyFilters, children: "Apply Filters" })
7374
+ ] })
6704
7375
  ] })
6705
- ] })
7376
+ ] }),
7377
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: () => navigate("/business/create"), children: "Create Business" })
6706
7378
  ] })
6707
7379
  ] }) }) }),
6708
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 mt-4 rounded-lg border bg-card overflow-hidden flex flex-col", children: [
6709
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full table-fixed", children: [
6710
- /* @__PURE__ */ jsxRuntime.jsxs("colgroup", { children: [
6711
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-28" }),
6712
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-36" }),
6713
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-52" }),
6714
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-32" }),
6715
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-36" }),
6716
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-32" }),
6717
- /* @__PURE__ */ jsxRuntime.jsx("col", { className: "w-auto" })
6718
- ] }),
6719
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "sticky top-0 bg-card z-10 shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "border-b", children: [
6720
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Alert ID" }),
6721
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Created At" }),
6722
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Type" }),
6723
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Status" }),
6724
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Context Type" }),
6725
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "RFI Status" }),
6726
- /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-3 py-2 text-left text-xs font-medium bg-muted/50", children: "Description" })
6727
- ] }) }),
6728
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: paginatedAlerts.map((alert) => /* @__PURE__ */ jsxRuntime.jsxs(
6729
- "tr",
7380
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto px-4 h-full max-w-none flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 mt-4 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
7381
+ DataTable,
7382
+ {
7383
+ columns,
7384
+ data: sortedBusinesses,
7385
+ sortBy,
7386
+ sortDirection,
7387
+ onSort: handleSort,
7388
+ onRowClick: handleRowClick
7389
+ }
7390
+ ) }) }) })
7391
+ ] });
7392
+ };
7393
+ var Businesses_default = Businesses;
7394
+ var businessAccounts = [
7395
+ {
7396
+ id: "acc-001",
7397
+ name: "Primary Operating Account",
7398
+ number: "****7890",
7399
+ type: "checking",
7400
+ status: "active",
7401
+ balance: "$125,450.00",
7402
+ currency: "USD",
7403
+ institution: "Chase Bank",
7404
+ routingNumber: "021000021",
7405
+ country: "US"
7406
+ },
7407
+ {
7408
+ id: "acc-002",
7409
+ name: "Business Savings",
7410
+ number: "****4567",
7411
+ type: "savings",
7412
+ status: "active",
7413
+ balance: "$45,230.00",
7414
+ currency: "USD",
7415
+ institution: "Chase Bank",
7416
+ routingNumber: "021000021",
7417
+ country: "US"
7418
+ },
7419
+ {
7420
+ id: "acc-003",
7421
+ name: "Payroll Account",
7422
+ number: "****1234",
7423
+ type: "checking",
7424
+ status: "active",
7425
+ balance: "$78,900.00",
7426
+ currency: "USD",
7427
+ institution: "Wells Fargo",
7428
+ routingNumber: "121000248",
7429
+ country: "US"
7430
+ }
7431
+ ];
7432
+ var businessCounterparties = [
7433
+ {
7434
+ id: "cp-001",
7435
+ name: "Tech Solutions Inc",
7436
+ type: "BUSINESS",
7437
+ status: "active",
7438
+ description: "Technology vendor and service provider",
7439
+ lastTransaction: "2024-01-15"
7440
+ },
7441
+ {
7442
+ id: "cp-002",
7443
+ name: "Global Logistics LLC",
7444
+ type: "BUSINESS",
7445
+ status: "active",
7446
+ description: "Shipping and logistics partner",
7447
+ lastTransaction: "2024-01-10"
7448
+ },
7449
+ {
7450
+ id: "cp-003",
7451
+ name: "Marketing Pros Agency",
7452
+ type: "BUSINESS",
7453
+ status: "active",
7454
+ description: "Marketing and advertising services",
7455
+ lastTransaction: "2024-01-08"
7456
+ },
7457
+ {
7458
+ id: "cp-004",
7459
+ name: "John Smith Consulting",
7460
+ type: "INDIVIDUAL",
7461
+ status: "active",
7462
+ description: "Independent business consultant",
7463
+ lastTransaction: "2023-12-20"
7464
+ }
7465
+ ];
7466
+ var Business = () => {
7467
+ const accountColumns = [
7468
+ {
7469
+ key: "number",
7470
+ title: "Account Number",
7471
+ sortable: true
7472
+ },
7473
+ {
7474
+ key: "name",
7475
+ title: "Account Name",
7476
+ sortable: true
7477
+ },
7478
+ {
7479
+ key: "balance",
7480
+ title: "Available Balance",
7481
+ sortable: true,
7482
+ align: "right"
7483
+ },
7484
+ {
7485
+ key: "status",
7486
+ title: "Status",
7487
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx(StatusBadge, { status: value })
7488
+ }
7489
+ ];
7490
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
7491
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Business Management" }) }),
7492
+ /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: "profile", className: "space-y-6", children: [
7493
+ /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: "inline-flex gap-8 h-auto bg-transparent border-b border-border w-full p-0 rounded-none justify-start", children: [
7494
+ /* @__PURE__ */ jsxRuntime.jsx(
7495
+ TabsTrigger,
6730
7496
  {
6731
- className: "border-b hover:bg-muted/50 transition-colors cursor-pointer",
6732
- onClick: () => navigate(`/alerts/${alert.id}`),
6733
- children: [
6734
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: alert.id }),
6735
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs", children: alert.createdAt }),
6736
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant(alert.type), className: "whitespace-nowrap", children: alert.type }) }),
6737
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs font-medium", getStatusColor(alert.status)), children: alert.status }) }),
6738
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", className: "whitespace-nowrap", children: alert.contextType }) }),
6739
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2", children: alert.rfiStatus && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", className: "whitespace-nowrap", children: alert.rfiStatus }) }),
6740
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-3 py-2 text-xs truncate", children: alert.description })
6741
- ]
6742
- },
6743
- alert.id
6744
- )) })
6745
- ] }) }),
6746
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-none border-t bg-background py-3 px-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
6747
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6748
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Rows per page:" }),
6749
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
6750
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", className: "h-8 gap-1", children: [
6751
- rowsPerPage,
6752
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 rotate-90" })
6753
- ] }) }),
6754
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "start", className: "bg-background z-50", children: [
6755
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(100), children: "100" }),
6756
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(200), children: "200" }),
6757
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { onClick: () => handleRowsPerPageChange(500), children: "500" })
6758
- ] })
7497
+ value: "profile",
7498
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7499
+ children: "Profile"
7500
+ }
7501
+ ),
7502
+ /* @__PURE__ */ jsxRuntime.jsx(
7503
+ TabsTrigger,
7504
+ {
7505
+ value: "kyc",
7506
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7507
+ children: "KYC"
7508
+ }
7509
+ ),
7510
+ /* @__PURE__ */ jsxRuntime.jsx(
7511
+ TabsTrigger,
7512
+ {
7513
+ value: "counterparty",
7514
+ className: "rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none pb-3",
7515
+ children: "Counterparty"
7516
+ }
7517
+ )
7518
+ ] }),
7519
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "profile", className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row items-start gap-6", children: [
7520
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-6", children: [
7521
+ /* @__PURE__ */ jsxRuntime.jsx(BusinessProfileCard, { isEditing: false, onToggleEdit: () => {
7522
+ } }),
7523
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
7524
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-4", children: [
7525
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: "Accounts" }),
7526
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", children: "+ New Account" })
7527
+ ] }),
7528
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
7529
+ DataTable,
7530
+ {
7531
+ columns: accountColumns,
7532
+ data: businessAccounts,
7533
+ emptyMessage: "No accounts found"
7534
+ }
7535
+ ) })
6759
7536
  ] })
6760
7537
  ] }),
6761
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
6762
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground", children: [
6763
- "Page ",
6764
- currentPage,
6765
- " of ",
6766
- totalPages
7538
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(BusinessStatusCard, { isEditing: false, onToggleEdit: () => {
7539
+ } }) })
7540
+ ] }) }),
7541
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "kyc", className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-8 text-center text-muted-foreground", children: "KYC content coming soon" }) }),
7542
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "counterparty", className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6", children: businessCounterparties.map((counterparty) => /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
7543
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { children: [
7544
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
7545
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "text-lg", children: counterparty.name }),
7546
+ /* @__PURE__ */ jsxRuntime.jsx(CounterpartyTypeBadge, { type: counterparty.type })
6767
7547
  ] }),
6768
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
6769
- /* @__PURE__ */ jsxRuntime.jsx(
6770
- Button,
6771
- {
6772
- variant: "outline",
6773
- size: "sm",
6774
- className: "h-8 w-8 p-0",
6775
- onClick: () => handlePageChange(currentPage - 1),
6776
- disabled: currentPage === 1,
6777
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
6778
- }
6779
- ),
6780
- /* @__PURE__ */ jsxRuntime.jsx(
6781
- Button,
6782
- {
6783
- variant: "outline",
6784
- size: "sm",
6785
- className: "h-8 w-8 p-0",
6786
- onClick: () => handlePageChange(currentPage + 1),
6787
- disabled: currentPage === totalPages,
6788
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
6789
- }
6790
- )
7548
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: counterparty.status === "active" ? "default" : "secondary", children: counterparty.status }) })
7549
+ ] }),
7550
+ /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-3", children: [
7551
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: counterparty.description }),
7552
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center text-sm", children: [
7553
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Last Transaction" }),
7554
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: counterparty.lastTransaction })
6791
7555
  ] })
6792
7556
  ] })
6793
- ] }) })
6794
- ] }) }) })
7557
+ ] }, counterparty.id)) }) })
7558
+ ] })
6795
7559
  ] });
6796
7560
  };
6797
- var Alerts_default = Alerts;
6798
- var Business = () => {
6799
- return /* @__PURE__ */ jsxRuntime.jsx(
6800
- DetailPageLayout,
6801
- {
6802
- title: "Business Management",
6803
- description: "Manage business entities and their configurations",
6804
- cards: [
6805
- {
6806
- key: "profile",
6807
- component: BusinessProfileCard,
6808
- expandOnEdit: true
6809
- },
6810
- {
6811
- key: "status",
6812
- component: BusinessStatusCard,
6813
- expandOnEdit: true
6814
- },
6815
- {
6816
- key: "contact",
6817
- component: ContactInfoCard,
6818
- expandOnEdit: true
6819
- },
6820
- {
6821
- key: "banking",
6822
- component: BankingDetailsCard,
6823
- expandOnEdit: true
6824
- }
6825
- ],
6826
- actions: [
6827
- {
6828
- label: "Export Data",
6829
- variant: "outline"
6830
- },
6831
- {
6832
- label: "Edit Business",
6833
- className: "bg-gradient-primary hover:opacity-90"
6834
- }
6835
- ]
6836
- }
6837
- );
6838
- };
6839
- var Business_default = Business;
7561
+ var BusinessDetail_default = Business;
6840
7562
  var CreateBusiness = () => {
6841
7563
  const [businessType, setBusinessType] = React13.useState("");
6842
7564
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -7208,6 +7930,258 @@ var NotFound = () => {
7208
7930
  };
7209
7931
  var NotFound_default = NotFound;
7210
7932
 
7933
+ // src/lib/mock-data/statement-data.ts
7934
+ var mockStatementHeader = {
7935
+ account: "1234567890",
7936
+ productId: "PROD-001",
7937
+ programId: "PROG-001",
7938
+ startDate: "01/01/2024 00:00:00",
7939
+ endDate: "01/31/2024 23:59:59",
7940
+ startingBalance: "$125,450.00",
7941
+ endingBalance: "$158,320.50"
7942
+ };
7943
+ var mockStatementTransactions = [
7944
+ { transactionType: "ACH Credit", direction: "CREDIT", amount: 45e3, count: 12 },
7945
+ { transactionType: "ACH Debit", direction: "DEBIT", amount: 23500, count: 8 },
7946
+ { transactionType: "Wire Transfer In", direction: "CREDIT", amount: 15e3, count: 3 },
7947
+ { transactionType: "Wire Transfer Out", direction: "DEBIT", amount: 8200, count: 2 },
7948
+ { transactionType: "Card Purchase", direction: "DEBIT", amount: 5430.5, count: 45 },
7949
+ { transactionType: "Direct Deposit", direction: "CREDIT", amount: 12500, count: 5 },
7950
+ { transactionType: "ATM Withdrawal", direction: "DEBIT", amount: 3200, count: 16 },
7951
+ { transactionType: "Check Deposit", direction: "CREDIT", amount: 8900, count: 4 },
7952
+ { transactionType: "Bill Payment", direction: "DEBIT", amount: 6780, count: 18 },
7953
+ { transactionType: "Transfer In", direction: "CREDIT", amount: 5200, count: 7 },
7954
+ { transactionType: "Transfer Out", direction: "DEBIT", amount: 4350, count: 6 },
7955
+ { transactionType: "Fee", direction: "DEBIT", amount: 125, count: 3 },
7956
+ { transactionType: "Interest", direction: "CREDIT", amount: 85.5, count: 1 },
7957
+ { transactionType: "Refund", direction: "CREDIT", amount: 450, count: 2 }
7958
+ ];
7959
+ var mockPrograms = [
7960
+ { value: "PROG-001", label: "Consumer Banking Program" },
7961
+ { value: "PROG-002", label: "Business Banking Program" },
7962
+ { value: "PROG-003", label: "Premium Rewards Program" }
7963
+ ];
7964
+ var mockProducts = [
7965
+ { value: "PROD-001", label: "Checking Account" },
7966
+ { value: "PROD-002", label: "Savings Account" },
7967
+ { value: "PROD-003", label: "Money Market Account" },
7968
+ { value: "PROD-004", label: "Business Checking" }
7969
+ ];
7970
+ var statementTypes = [
7971
+ { value: "root", label: "Root" },
7972
+ { value: "program", label: "Program" },
7973
+ { value: "product", label: "Product" },
7974
+ { value: "account", label: "Account" }
7975
+ ];
7976
+ function Statement() {
7977
+ const [statementType, setStatementType] = React13.useState("");
7978
+ const [selectedProgram, setSelectedProgram] = React13.useState("");
7979
+ const [selectedProduct, setSelectedProduct] = React13.useState("");
7980
+ const [accountNumber, setAccountNumber] = React13.useState("");
7981
+ const [startDate, setStartDate] = React13.useState();
7982
+ const [endDate, setEndDate] = React13.useState();
7983
+ const [statementGenerated, setStatementGenerated] = React13.useState(false);
7984
+ const handleStatementTypeChange = (value) => {
7985
+ setStatementType(value);
7986
+ setSelectedProgram("");
7987
+ setSelectedProduct("");
7988
+ setAccountNumber("");
7989
+ };
7990
+ const handleGenerateStatement = () => {
7991
+ if (!statementType || !startDate || !endDate) return;
7992
+ if (statementType === "program" && !selectedProgram) return;
7993
+ if (statementType === "product" && !selectedProduct) return;
7994
+ if (statementType === "account" && !accountNumber) return;
7995
+ setStatementGenerated(true);
7996
+ };
7997
+ const isGenerateDisabled = () => {
7998
+ if (!statementType || !startDate || !endDate) return true;
7999
+ if (statementType === "program" && !selectedProgram) return true;
8000
+ if (statementType === "product" && !selectedProduct) return true;
8001
+ if (statementType === "account" && !accountNumber) return true;
8002
+ return false;
8003
+ };
8004
+ const columns = [
8005
+ {
8006
+ key: "transactionType",
8007
+ title: "Transaction Type",
8008
+ sortable: true,
8009
+ align: "left"
8010
+ },
8011
+ {
8012
+ key: "direction",
8013
+ title: "Direction",
8014
+ sortable: true,
8015
+ align: "left",
8016
+ render: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: value === "CREDIT" ? "success" : "secondary", children: value })
8017
+ },
8018
+ {
8019
+ key: "amount",
8020
+ title: "Amount",
8021
+ sortable: true,
8022
+ align: "right",
8023
+ render: (value) => `$${value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
8024
+ },
8025
+ {
8026
+ key: "count",
8027
+ title: "Count",
8028
+ sortable: true,
8029
+ align: "right"
8030
+ }
8031
+ ];
8032
+ const handleDownloadCSV = () => {
8033
+ console.log("Downloading CSV...");
8034
+ };
8035
+ const handlePrintPDF = () => {
8036
+ console.log("Printing PDF...");
8037
+ };
8038
+ const handleEdit = () => {
8039
+ setStatementGenerated(false);
8040
+ };
8041
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [
8042
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
8043
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Statement" }),
8044
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children: "Generate and view statement reports" })
8045
+ ] }),
8046
+ !statementGenerated && /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
8047
+ /* @__PURE__ */ jsxRuntime.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Parameters" }) }),
8048
+ /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "space-y-4", children: [
8049
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4", children: [
8050
+ /* @__PURE__ */ jsxRuntime.jsx(
8051
+ EnhancedSelect,
8052
+ {
8053
+ label: "Statement Type",
8054
+ placeholder: "Select type",
8055
+ options: statementTypes,
8056
+ value: statementType,
8057
+ onValueChange: handleStatementTypeChange
8058
+ }
8059
+ ),
8060
+ statementType === "program" && /* @__PURE__ */ jsxRuntime.jsx(
8061
+ EnhancedSelect,
8062
+ {
8063
+ label: "Program Name",
8064
+ placeholder: "Select program",
8065
+ options: mockPrograms,
8066
+ value: selectedProgram,
8067
+ onValueChange: setSelectedProgram
8068
+ }
8069
+ ),
8070
+ statementType === "product" && /* @__PURE__ */ jsxRuntime.jsx(
8071
+ EnhancedSelect,
8072
+ {
8073
+ label: "Product Name",
8074
+ placeholder: "Select product",
8075
+ options: mockProducts,
8076
+ value: selectedProduct,
8077
+ onValueChange: setSelectedProduct
8078
+ }
8079
+ ),
8080
+ statementType === "account" && /* @__PURE__ */ jsxRuntime.jsx(
8081
+ EnhancedInput,
8082
+ {
8083
+ label: "Account Number",
8084
+ placeholder: "Enter account number",
8085
+ value: accountNumber,
8086
+ onChange: (e) => setAccountNumber(e.target.value)
8087
+ }
8088
+ ),
8089
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
8090
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "Start Date" }),
8091
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
8092
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8093
+ Button,
8094
+ {
8095
+ variant: "outline",
8096
+ className: cn(
8097
+ "justify-start text-left font-normal",
8098
+ !startDate && "text-muted-foreground"
8099
+ ),
8100
+ children: [
8101
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
8102
+ startDate ? dateFns.format(startDate, "MM/dd/yyyy") : "Select date"
8103
+ ]
8104
+ }
8105
+ ) }),
8106
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
8107
+ Calendar,
8108
+ {
8109
+ mode: "single",
8110
+ selected: startDate,
8111
+ onSelect: setStartDate,
8112
+ initialFocus: true
8113
+ }
8114
+ ) })
8115
+ ] })
8116
+ ] }),
8117
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
8118
+ /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium", children: "End Date" }),
8119
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
8120
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8121
+ Button,
8122
+ {
8123
+ variant: "outline",
8124
+ className: cn(
8125
+ "justify-start text-left font-normal",
8126
+ !endDate && "text-muted-foreground"
8127
+ ),
8128
+ children: [
8129
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "mr-2 h-4 w-4" }),
8130
+ endDate ? dateFns.format(endDate, "MM/dd/yyyy") : "Select date"
8131
+ ]
8132
+ }
8133
+ ) }),
8134
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsx(
8135
+ Calendar,
8136
+ {
8137
+ mode: "single",
8138
+ selected: endDate,
8139
+ onSelect: setEndDate,
8140
+ initialFocus: true
8141
+ }
8142
+ ) })
8143
+ ] })
8144
+ ] })
8145
+ ] }),
8146
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
8147
+ Button,
8148
+ {
8149
+ onClick: handleGenerateStatement,
8150
+ disabled: isGenerateDisabled(),
8151
+ children: "Generate Statement"
8152
+ }
8153
+ ) })
8154
+ ] })
8155
+ ] }),
8156
+ statementGenerated && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8157
+ /* @__PURE__ */ jsxRuntime.jsx(StatementHeader, { data: mockStatementHeader, onEdit: handleEdit }),
8158
+ /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
8159
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
8160
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Transaction Summary" }),
8161
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8162
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", onClick: handleDownloadCSV, children: [
8163
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4 mr-2" }),
8164
+ "Download CSV"
8165
+ ] }),
8166
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", onClick: handlePrintPDF, children: [
8167
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-4 w-4 mr-2" }),
8168
+ "Print PDF"
8169
+ ] })
8170
+ ] })
8171
+ ] }),
8172
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
8173
+ DataTable,
8174
+ {
8175
+ columns,
8176
+ data: mockStatementTransactions,
8177
+ emptyMessage: "No transactions found"
8178
+ }
8179
+ ) })
8180
+ ] })
8181
+ ] })
8182
+ ] });
8183
+ }
8184
+
7211
8185
  // src/lib/mock-data/transaction-data.ts
7212
8186
  var mockTransactions = [
7213
8187
  {
@@ -8624,6 +9598,7 @@ exports.ACHTransferSection = ACHTransferSection;
8624
9598
  exports.AccountCard = AccountCard;
8625
9599
  exports.AddressForm = AddressForm;
8626
9600
  exports.AlertDetail = AlertDetail_default;
9601
+ exports.AlertDetailView = AlertDetailView;
8627
9602
  exports.AlertDocuments = AlertDocuments;
8628
9603
  exports.AlertNotes = AlertNotes;
8629
9604
  exports.AlertTimeline = AlertTimeline;
@@ -8638,10 +9613,11 @@ exports.BeneficiaryAddress = BeneficiaryAddress;
8638
9613
  exports.BeneficiaryCard = BeneficiaryCard;
8639
9614
  exports.BeneficiaryDomesticWire = BeneficiaryDomesticWire;
8640
9615
  exports.Breadcrumb = Breadcrumb;
8641
- exports.Business = Business_default;
9616
+ exports.BusinessDetail = BusinessDetail_default;
8642
9617
  exports.BusinessProfileCard = BusinessProfileCard;
8643
9618
  exports.BusinessStatusCard = BusinessStatusCard;
8644
9619
  exports.BusinessTypeBadge = BusinessTypeBadge;
9620
+ exports.Businesses = Businesses_default;
8645
9621
  exports.Button = Button;
8646
9622
  exports.Calendar = Calendar;
8647
9623
  exports.Card = Card;
@@ -8752,6 +9728,8 @@ exports.SidebarRail = SidebarRail;
8752
9728
  exports.SidebarSeparator = SidebarSeparator;
8753
9729
  exports.SidebarTrigger = SidebarTrigger;
8754
9730
  exports.Stack = Stack;
9731
+ exports.Statement = Statement;
9732
+ exports.StatementHeader = StatementHeader;
8755
9733
  exports.StatusBadge = StatusBadge;
8756
9734
  exports.Tabs = Tabs;
8757
9735
  exports.TabsContent = TabsContent;
@@ -8782,6 +9760,7 @@ exports.inputVariants = inputVariants;
8782
9760
  exports.reducer = reducer;
8783
9761
  exports.textareaVariants = textareaVariants;
8784
9762
  exports.toast = toast;
9763
+ exports.useAlertDetail = useAlertDetail;
8785
9764
  exports.useEditState = useEditState;
8786
9765
  exports.useFormWithEditState = useFormWithEditState;
8787
9766
  exports.useIsMobile = useIsMobile;