@iblai/iblai-js 1.14.0 → 1.16.1
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.
|
@@ -117203,7 +117203,7 @@ function NotificationDropdown({ org, userId, className, onViewNotifications, })
|
|
|
117203
117203
|
}
|
|
117204
117204
|
}
|
|
117205
117205
|
}, [showOnlyUnread, notifications]);
|
|
117206
|
-
return (jsx(Fragment$1, { children: jsxs(DropdownMenu, { open: notificationsOpen, onOpenChange: setNotificationsOpen, children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "icon", className: `relative ${className}`, "aria-label": `${(_a = notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count) !== null && _a !== void 0 ? _a : 0} Notification${(notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count) === 1 ? '' : 's'}`, children: [jsx(Bell, { className: "h-
|
|
117206
|
+
return (jsx(Fragment$1, { children: jsxs(DropdownMenu, { open: notificationsOpen, onOpenChange: setNotificationsOpen, children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "icon", className: `relative ${className}`, "aria-label": `${(_a = notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count) !== null && _a !== void 0 ? _a : 0} Notification${(notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count) === 1 ? '' : 's'}`, children: [jsx(Bell, { className: "h-5! w-5!" }), !isNotificationCountLoading &&
|
|
117207
117207
|
// @ts-expect-error count is not part of the notifictionCount object
|
|
117208
117208
|
Number(notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count) > 0 && (jsx("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-xs text-white", children: notificationCount === null || notificationCount === void 0 ? void 0 : notificationCount.count }))] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-[300px] p-2 z-[9999] border border-gray-100 max-h-[300px] overflow-y-auto", children: [jsxs("div", { className: "px-4 py-3 text-sm font-semibold border-b border-gray-100 flex items-center justify-between", children: [jsx("span", { children: "Notifications" }), jsx(Button$1, { variant: "link", size: "sm", className: "text-sm text-blue-600 h-auto p-0", onClick: () => onViewNotifications === null || onViewNotifications === void 0 ? void 0 : onViewNotifications(), children: "View all" })] }), isLoading && (jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "Loading notifications..." })), (!isLoading && isError) ||
|
|
117209
117209
|
(!isLoading && !isError && filteredNotifications.length === 0) ? (jsx("div", { className: "px-3 py-2 text-sm text-gray-500", children: "No new notifications." })) : (jsxs(Fragment$1, { children: [!isLoading &&
|
|
@@ -192340,7 +192340,7 @@ function CreditBalance({ tenant, username, mainPlatformKey, currentUserEmail, re
|
|
|
192340
192340
|
setOpen(false);
|
|
192341
192341
|
setIsAddCreditsModalOpen(true);
|
|
192342
192342
|
};
|
|
192343
|
-
return (jsxs(DropdownMenu, { open: open, onOpenChange: handleOpenChange, children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "icon", className: cn('relative', className), "data-testid": "credit-balance-trigger", "aria-label": billing ? `${balance.toLocaleString('en-US')} credits remaining` : 'Credit balance', children: [jsx(CreditCard, { className: "h-
|
|
192343
|
+
return (jsxs(DropdownMenu, { open: open, onOpenChange: handleOpenChange, children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "icon", className: cn('relative', className), "data-testid": "credit-balance-trigger", "aria-label": billing ? `${balance.toLocaleString('en-US')} credits remaining` : 'Credit balance', children: [jsx(CreditCard, { className: "h-5! w-5!" }), billing && status !== 'healthy' && (jsx("span", { className: "absolute -top-1 -right-1 flex h-2.5 w-2.5 rounded-full ring-2 ring-white", style: { backgroundColor: palette.dot }, "aria-hidden": "true" }))] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-[320px] p-0 z-9999 border border-gray-100", "data-testid": "credit-balance-panel", children: [isFetching && !billing ? (jsx("div", { className: "px-3 py-3 text-sm text-gray-500", children: "Loading credits..." })) : isError || !billing ? (jsx("div", { className: "px-3 py-3 text-sm text-gray-500", children: "Unable to load credit balance." })) : (jsxs(Fragment$1, { children: [jsxs("div", { className: "space-y-3 p-4", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx("span", { className: "text-sm font-normal text-[#717985]", children: "Remaining" }), jsxs("span", { className: "text-sm font-medium text-[#101828]", children: [balance.toLocaleString('en-US'), " Credits"] })] }), billing.consumed_credits != null && (jsxs("div", { className: "flex items-center justify-between", children: [jsx("span", { className: "text-sm font-normal text-[#717985]", children: "Consumed" }), jsxs("span", { className: "text-sm font-medium text-[#101828]", children: [parseInt(billing.consumed_credits || '0', 10).toLocaleString('en-US'), " Credits"] })] })), billing.credits_reset_date && (jsxs("div", { className: "flex items-center justify-between", children: [jsx("span", { className: "text-sm font-normal text-[#717985]", children: "Resets on" }), jsx("span", { className: "text-sm font-medium text-[#101828]", children: formatResetDate(billing.credits_reset_date) })] }))] }), !isFreePlan && !isTrialPlan && hasPaymentMethod && (jsxs("div", { className: "border-t border-gray-100 p-4 space-y-3", children: [jsxs("div", { className: "flex items-center justify-between gap-3", children: [jsx("span", { className: "text-sm font-normal text-[#717985]", children: "Auto Recharge" }), jsx("span", { className: "rounded-full px-2 py-0.5 text-xs font-medium", style: {
|
|
192344
192344
|
backgroundColor: isAutoRechargeEnabled ? '#f5f8ff' : '#f3f4f6',
|
|
192345
192345
|
color: isAutoRechargeEnabled ? '#155dfc' : '#6a7282',
|
|
192346
192346
|
border: `1px solid ${isAutoRechargeEnabled ? '#d0e0ff' : '#e5e7eb'}`,
|