@retinalabsllc/zairusjs 16.1.1 → 16.1.3
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.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +78 -8
- package/dist/index.mjs +80 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1030,11 +1030,23 @@ interface NotificationItem2 {
|
|
|
1030
1030
|
title: string;
|
|
1031
1031
|
message: string;
|
|
1032
1032
|
isRead: boolean;
|
|
1033
|
+
type?: string;
|
|
1034
|
+
meta_json?: any;
|
|
1033
1035
|
createdAt: string | Date;
|
|
1034
1036
|
}
|
|
1037
|
+
interface BarIconProps {
|
|
1038
|
+
icon: any;
|
|
1039
|
+
color?: string;
|
|
1040
|
+
onClick?: () => void;
|
|
1041
|
+
}
|
|
1035
1042
|
interface UniversalHome2Props {
|
|
1036
1043
|
fullName?: string;
|
|
1037
1044
|
avatarSrc?: string | null;
|
|
1045
|
+
userStatus?: 'ACTIVE' | 'BUSY' | 'AWAY' | 'OFFLINE' | string;
|
|
1046
|
+
organizations?: any[];
|
|
1047
|
+
activeOrgId?: string;
|
|
1048
|
+
onOrganizationSelect?: (orgId: string) => void;
|
|
1049
|
+
barIcons?: BarIconProps[];
|
|
1038
1050
|
createHuddleAction?: HomeActionBtn2;
|
|
1039
1051
|
joinHuddleAction?: HomeActionBtn2;
|
|
1040
1052
|
notifications?: NotificationItem2[];
|
|
@@ -1043,10 +1055,11 @@ interface UniversalHome2Props {
|
|
|
1043
1055
|
isNotifsLoading?: boolean;
|
|
1044
1056
|
onNotificationPageChange?: (page: number) => void;
|
|
1045
1057
|
onNotificationClick?: (notif: NotificationItem2) => void;
|
|
1058
|
+
onResolveInvite?: (notif: NotificationItem2, resolution: 'ACCEPTED' | 'REJECTED') => Promise<void>;
|
|
1046
1059
|
formatNotifDate: (date: string | Date) => string;
|
|
1047
1060
|
customContent?: React.ReactNode;
|
|
1048
1061
|
departmentsProps: UniversalDepartmentsPageProps;
|
|
1049
1062
|
}
|
|
1050
1063
|
declare const UniversalHome2: React.FC<UniversalHome2Props>;
|
|
1051
1064
|
|
|
1052
|
-
export { AppBento2, type AppBento2Props, type BannerProps, type BentoFeature, type BoardMember, type CardData, CardInfoDialog, type CardInfoDialogProps, type CompanyDetails, type ConsultantProfile, ConsultantShowcase, type ConsultantShowcaseProps, ContentGridBlock, type ContentGridBlockProps, type CryptoOption, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, type FiatCurrencyOption, Footer, type FooterColumn, type FooterLink, type FooterProps, FundCardDialog, type FundCardDialogProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, type AppLogo$1 as HeroAppLogo, HeroSection, type HeroSectionProps, type HomeActionBtn, type HomeActionBtn2, type LeaderboardItem, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, MedicalFeatureStatsBlock, MobileNav, type MobileNavItem, type MobileNavProps, type NavItem, type NetworkOption, type NotificationItem, type NotificationItem2, NumberInput, type NumberInputProps, PageSpinner, type PageSpinnerProps, PinDialerBottomSheet, type PinDialerBottomSheetProps, PipleAuth, type PipleAuthProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type AppLogo as PricingAppLogo, type PricingFeature, type PricingFeature2, type PricingPlan, type PricingTab, type ProjectItem, type RateCalculationPayload, type ReferralProfile, type RewardItem, type RewardProfile, type ScrollFeature, type SocialContact, type SocialLink, type StatItem, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, type TierOption, UniversalBuyCryptoPage, type UniversalBuyCryptoPageProps, UniversalCardActionPage, type UniversalCardActionPageProps, UniversalCardPage, type UniversalCardPageProps, type UniversalDepartment, UniversalDepartmentsPage, type UniversalDepartmentsPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalHome2, type UniversalHome2Props, UniversalHomeView, type UniversalHomeViewProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalProfilePage, type UniversalProfilePageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, type UniversalReferralItem, UniversalReferralPage, type UniversalReferralPageProps, UniversalRewardPage, type UniversalRewardPageProps, UniversalSecurityPage, type UniversalSecurityPageProps, UniversalSidebar, type UniversalSidebarProps, type UniversalTransaction, UniversalTransactionPage, type UniversalTransactionPageProps, UniversalVerificationPage, type UniversalVerificationPageProps, type UniversalWallet, UniversalWalletPage, type UniversalWalletPageProps, type VerificationStatus, WaitlistDialog, type WaitlistDialogProps };
|
|
1065
|
+
export { AppBento2, type AppBento2Props, type BannerProps, type BarIconProps, type BentoFeature, type BoardMember, type CardData, CardInfoDialog, type CardInfoDialogProps, type CompanyDetails, type ConsultantProfile, ConsultantShowcase, type ConsultantShowcaseProps, ContentGridBlock, type ContentGridBlockProps, type CryptoOption, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, type FiatCurrencyOption, Footer, type FooterColumn, type FooterLink, type FooterProps, FundCardDialog, type FundCardDialogProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, type AppLogo$1 as HeroAppLogo, HeroSection, type HeroSectionProps, type HomeActionBtn, type HomeActionBtn2, type LeaderboardItem, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, MedicalFeatureStatsBlock, MobileNav, type MobileNavItem, type MobileNavProps, type NavItem, type NetworkOption, type NotificationItem, type NotificationItem2, NumberInput, type NumberInputProps, PageSpinner, type PageSpinnerProps, PinDialerBottomSheet, type PinDialerBottomSheetProps, PipleAuth, type PipleAuthProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type AppLogo as PricingAppLogo, type PricingFeature, type PricingFeature2, type PricingPlan, type PricingTab, type ProjectItem, type RateCalculationPayload, type ReferralProfile, type RewardItem, type RewardProfile, type ScrollFeature, type SocialContact, type SocialLink, type StatItem, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, type TierOption, UniversalBuyCryptoPage, type UniversalBuyCryptoPageProps, UniversalCardActionPage, type UniversalCardActionPageProps, UniversalCardPage, type UniversalCardPageProps, type UniversalDepartment, UniversalDepartmentsPage, type UniversalDepartmentsPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalHome2, type UniversalHome2Props, UniversalHomeView, type UniversalHomeViewProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalProfilePage, type UniversalProfilePageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, type UniversalReferralItem, UniversalReferralPage, type UniversalReferralPageProps, UniversalRewardPage, type UniversalRewardPageProps, UniversalSecurityPage, type UniversalSecurityPageProps, UniversalSidebar, type UniversalSidebarProps, type UniversalTransaction, UniversalTransactionPage, type UniversalTransactionPageProps, UniversalVerificationPage, type UniversalVerificationPageProps, type UniversalWallet, UniversalWalletPage, type UniversalWalletPageProps, type VerificationStatus, WaitlistDialog, type WaitlistDialogProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1030,11 +1030,23 @@ interface NotificationItem2 {
|
|
|
1030
1030
|
title: string;
|
|
1031
1031
|
message: string;
|
|
1032
1032
|
isRead: boolean;
|
|
1033
|
+
type?: string;
|
|
1034
|
+
meta_json?: any;
|
|
1033
1035
|
createdAt: string | Date;
|
|
1034
1036
|
}
|
|
1037
|
+
interface BarIconProps {
|
|
1038
|
+
icon: any;
|
|
1039
|
+
color?: string;
|
|
1040
|
+
onClick?: () => void;
|
|
1041
|
+
}
|
|
1035
1042
|
interface UniversalHome2Props {
|
|
1036
1043
|
fullName?: string;
|
|
1037
1044
|
avatarSrc?: string | null;
|
|
1045
|
+
userStatus?: 'ACTIVE' | 'BUSY' | 'AWAY' | 'OFFLINE' | string;
|
|
1046
|
+
organizations?: any[];
|
|
1047
|
+
activeOrgId?: string;
|
|
1048
|
+
onOrganizationSelect?: (orgId: string) => void;
|
|
1049
|
+
barIcons?: BarIconProps[];
|
|
1038
1050
|
createHuddleAction?: HomeActionBtn2;
|
|
1039
1051
|
joinHuddleAction?: HomeActionBtn2;
|
|
1040
1052
|
notifications?: NotificationItem2[];
|
|
@@ -1043,10 +1055,11 @@ interface UniversalHome2Props {
|
|
|
1043
1055
|
isNotifsLoading?: boolean;
|
|
1044
1056
|
onNotificationPageChange?: (page: number) => void;
|
|
1045
1057
|
onNotificationClick?: (notif: NotificationItem2) => void;
|
|
1058
|
+
onResolveInvite?: (notif: NotificationItem2, resolution: 'ACCEPTED' | 'REJECTED') => Promise<void>;
|
|
1046
1059
|
formatNotifDate: (date: string | Date) => string;
|
|
1047
1060
|
customContent?: React.ReactNode;
|
|
1048
1061
|
departmentsProps: UniversalDepartmentsPageProps;
|
|
1049
1062
|
}
|
|
1050
1063
|
declare const UniversalHome2: React.FC<UniversalHome2Props>;
|
|
1051
1064
|
|
|
1052
|
-
export { AppBento2, type AppBento2Props, type BannerProps, type BentoFeature, type BoardMember, type CardData, CardInfoDialog, type CardInfoDialogProps, type CompanyDetails, type ConsultantProfile, ConsultantShowcase, type ConsultantShowcaseProps, ContentGridBlock, type ContentGridBlockProps, type CryptoOption, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, type FiatCurrencyOption, Footer, type FooterColumn, type FooterLink, type FooterProps, FundCardDialog, type FundCardDialogProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, type AppLogo$1 as HeroAppLogo, HeroSection, type HeroSectionProps, type HomeActionBtn, type HomeActionBtn2, type LeaderboardItem, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, MedicalFeatureStatsBlock, MobileNav, type MobileNavItem, type MobileNavProps, type NavItem, type NetworkOption, type NotificationItem, type NotificationItem2, NumberInput, type NumberInputProps, PageSpinner, type PageSpinnerProps, PinDialerBottomSheet, type PinDialerBottomSheetProps, PipleAuth, type PipleAuthProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type AppLogo as PricingAppLogo, type PricingFeature, type PricingFeature2, type PricingPlan, type PricingTab, type ProjectItem, type RateCalculationPayload, type ReferralProfile, type RewardItem, type RewardProfile, type ScrollFeature, type SocialContact, type SocialLink, type StatItem, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, type TierOption, UniversalBuyCryptoPage, type UniversalBuyCryptoPageProps, UniversalCardActionPage, type UniversalCardActionPageProps, UniversalCardPage, type UniversalCardPageProps, type UniversalDepartment, UniversalDepartmentsPage, type UniversalDepartmentsPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalHome2, type UniversalHome2Props, UniversalHomeView, type UniversalHomeViewProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalProfilePage, type UniversalProfilePageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, type UniversalReferralItem, UniversalReferralPage, type UniversalReferralPageProps, UniversalRewardPage, type UniversalRewardPageProps, UniversalSecurityPage, type UniversalSecurityPageProps, UniversalSidebar, type UniversalSidebarProps, type UniversalTransaction, UniversalTransactionPage, type UniversalTransactionPageProps, UniversalVerificationPage, type UniversalVerificationPageProps, type UniversalWallet, UniversalWalletPage, type UniversalWalletPageProps, type VerificationStatus, WaitlistDialog, type WaitlistDialogProps };
|
|
1065
|
+
export { AppBento2, type AppBento2Props, type BannerProps, type BarIconProps, type BentoFeature, type BoardMember, type CardData, CardInfoDialog, type CardInfoDialogProps, type CompanyDetails, type ConsultantProfile, ConsultantShowcase, type ConsultantShowcaseProps, ContentGridBlock, type ContentGridBlockProps, type CryptoOption, type DocumentSectionData, type EmailContact, Faq, type FaqItem, type FaqProps, FeatureScroll, type FeatureScrollProps, type FiatCurrencyOption, Footer, type FooterColumn, type FooterLink, type FooterProps, FundCardDialog, type FundCardDialogProps, GifFeatureCard, type GifFeatureCardProps, Header, type HeaderLink, type HeaderProps, type AppLogo$1 as HeroAppLogo, HeroSection, type HeroSectionProps, type HomeActionBtn, type HomeActionBtn2, type LeaderboardItem, ManagedBoardBlock, type ManagedBoardBlockProps, ManagedContactBlock, type ManagedContactBlockProps, ManagedDocument, type ManagedDocumentProps, ManagedNewsletterSplitBlock, type ManagedNewsletterSplitBlockProps, ManagedNotFoundBlock, type ManagedNotFoundBlockProps, ManagedPricingBlock, type ManagedPricingBlockProps, ManagedProjectsBlock, type ManagedProjectsBlockProps, ManagedToaster, MedicalFeatureStatsBlock, MobileNav, type MobileNavItem, type MobileNavProps, type NavItem, type NetworkOption, type NotificationItem, type NotificationItem2, NumberInput, type NumberInputProps, PageSpinner, type PageSpinnerProps, PinDialerBottomSheet, type PinDialerBottomSheetProps, PipleAuth, type PipleAuthProps, type PlatformFeatureItem, PlatformFeatures, type PlatformFeaturesProps, PortfolioHero, type PortfolioHeroProps, type AppLogo as PricingAppLogo, type PricingFeature, type PricingFeature2, type PricingPlan, type PricingTab, type ProjectItem, type RateCalculationPayload, type ReferralProfile, type RewardItem, type RewardProfile, type ScrollFeature, type SocialContact, type SocialLink, type StatItem, TextInput, type TextInputProps, ThreeDActionButton, type ThreeDActionButtonProps, ThreeDButton, type ThreeDButtonProps, type TierOption, UniversalBuyCryptoPage, type UniversalBuyCryptoPageProps, UniversalCardActionPage, type UniversalCardActionPageProps, UniversalCardPage, type UniversalCardPageProps, type UniversalDepartment, UniversalDepartmentsPage, type UniversalDepartmentsPageProps, UniversalErrorView, type UniversalErrorViewProps, UniversalHome2, type UniversalHome2Props, UniversalHomeView, type UniversalHomeViewProps, type UniversalMember, UniversalMembersPage, type UniversalMembersPageProps, UniversalOrganizationPage, type UniversalOrganizationPageProps, UniversalProfilePage, type UniversalProfilePageProps, UniversalProfileSettings, type UniversalProfileSettingsProps, type UniversalReferralItem, UniversalReferralPage, type UniversalReferralPageProps, UniversalRewardPage, type UniversalRewardPageProps, UniversalSecurityPage, type UniversalSecurityPageProps, UniversalSidebar, type UniversalSidebarProps, type UniversalTransaction, UniversalTransactionPage, type UniversalTransactionPageProps, UniversalVerificationPage, type UniversalVerificationPageProps, type UniversalWallet, UniversalWalletPage, type UniversalWalletPageProps, type VerificationStatus, WaitlistDialog, type WaitlistDialogProps };
|
package/dist/index.js
CHANGED
|
@@ -610,7 +610,7 @@ function AuthFormInner({
|
|
|
610
610
|
onKeyDown: (e) => {
|
|
611
611
|
if (e.key === "Backspace" && !otp[index] && index > 0) inputRefs.current[index - 1]?.focus();
|
|
612
612
|
},
|
|
613
|
-
className: "w-10 h-
|
|
613
|
+
className: "w-10 h-10 text-center text-sm bg-transparent border-b-2 border-neutral-200 text-black outline-none focus:border-black transition-all duration-300"
|
|
614
614
|
}
|
|
615
615
|
))), /* @__PURE__ */ import_react6.default.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ import_react6.default.createElement(ThreeDActionButton, { type: "submit", disabled: otp.join("").length < 6, isLoading: isSubmitting, className: "w-full" }, "Verify Code"), !userHas2FA && /* @__PURE__ */ import_react6.default.createElement(
|
|
616
616
|
"button",
|
|
@@ -4812,10 +4812,15 @@ var UniversalMembersPage = ({
|
|
|
4812
4812
|
var import_react81 = __toESM(require("react"));
|
|
4813
4813
|
var import_navigation6 = require("next/navigation");
|
|
4814
4814
|
var import_react82 = require("@hugeicons/react");
|
|
4815
|
+
var import_react_hot_toast14 = __toESM(require("react-hot-toast"));
|
|
4815
4816
|
var import_core_free_icons29 = require("@hugeicons/core-free-icons");
|
|
4816
4817
|
var UniversalHome2 = ({
|
|
4817
|
-
fullName = "",
|
|
4818
4818
|
avatarSrc,
|
|
4819
|
+
userStatus = "ACTIVE",
|
|
4820
|
+
organizations = [],
|
|
4821
|
+
activeOrgId,
|
|
4822
|
+
onOrganizationSelect,
|
|
4823
|
+
barIcons = [],
|
|
4819
4824
|
createHuddleAction,
|
|
4820
4825
|
joinHuddleAction,
|
|
4821
4826
|
notifications = [],
|
|
@@ -4824,18 +4829,48 @@ var UniversalHome2 = ({
|
|
|
4824
4829
|
isNotifsLoading = false,
|
|
4825
4830
|
onNotificationPageChange,
|
|
4826
4831
|
onNotificationClick,
|
|
4832
|
+
onResolveInvite,
|
|
4827
4833
|
formatNotifDate,
|
|
4828
4834
|
customContent,
|
|
4829
4835
|
departmentsProps
|
|
4830
4836
|
}) => {
|
|
4831
4837
|
const [isAvatarLoaded, setIsAvatarLoaded] = (0, import_react81.useState)(false);
|
|
4832
4838
|
const [showNotifDialog, setShowNotifDialog] = (0, import_react81.useState)(false);
|
|
4839
|
+
const [showOrgSwitcher, setShowOrgSwitcher] = (0, import_react81.useState)(false);
|
|
4833
4840
|
const [selectedNotif, setSelectedNotif] = (0, import_react81.useState)(null);
|
|
4841
|
+
const [isResolving, setIsResolving] = (0, import_react81.useState)(false);
|
|
4834
4842
|
const router = (0, import_navigation6.useRouter)();
|
|
4835
4843
|
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4836
4844
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
4837
4845
|
const hasUnreadNotifs = notifications.some((n) => !n.isRead);
|
|
4838
|
-
|
|
4846
|
+
const getDisplayStatus = () => {
|
|
4847
|
+
if (userStatus === "ACTIVE") return "Online";
|
|
4848
|
+
if (userStatus === "BUSY") return "Busy";
|
|
4849
|
+
if (userStatus === "OFFLINE") return "Offline";
|
|
4850
|
+
if (userStatus === "AWAY") return "Away";
|
|
4851
|
+
return "Online";
|
|
4852
|
+
};
|
|
4853
|
+
const getStatusColor = () => {
|
|
4854
|
+
if (userStatus === "ACTIVE") return "bg-emerald-500";
|
|
4855
|
+
if (userStatus === "BUSY") return "bg-amber-500";
|
|
4856
|
+
if (userStatus === "OFFLINE") return "bg-rose-500";
|
|
4857
|
+
if (userStatus === "AWAY") return "bg-neutral-400";
|
|
4858
|
+
return "bg-emerald-500";
|
|
4859
|
+
};
|
|
4860
|
+
const handleResolve = async (resolution) => {
|
|
4861
|
+
if (!onResolveInvite || !selectedNotif) return;
|
|
4862
|
+
setIsResolving(true);
|
|
4863
|
+
try {
|
|
4864
|
+
await onResolveInvite(selectedNotif, resolution);
|
|
4865
|
+
setShowNotifDialog(false);
|
|
4866
|
+
setSelectedNotif(null);
|
|
4867
|
+
} catch (error) {
|
|
4868
|
+
import_react_hot_toast14.default.error("Failed to process invitation");
|
|
4869
|
+
} finally {
|
|
4870
|
+
setIsResolving(false);
|
|
4871
|
+
}
|
|
4872
|
+
};
|
|
4873
|
+
return /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-10 h-10 shrink-0 cursor-pointer", onClick: () => setShowOrgSwitcher(true) }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-white flex items-center justify-center" }, !isAvatarLoaded && /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-white" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ import_react81.default.createElement(
|
|
4839
4874
|
"img",
|
|
4840
4875
|
{
|
|
4841
4876
|
src: finalAvatarSrc,
|
|
@@ -4843,7 +4878,14 @@ var UniversalHome2 = ({
|
|
|
4843
4878
|
onLoad: () => setIsAvatarLoaded(true),
|
|
4844
4879
|
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
4845
4880
|
}
|
|
4846
|
-
))), /* @__PURE__ */ import_react81.default.createElement(
|
|
4881
|
+
))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4882
|
+
"button",
|
|
4883
|
+
{
|
|
4884
|
+
onClick: () => router.push("/app/settings"),
|
|
4885
|
+
className: "relative w-10 h-10 flex items-center justify-center rounded-full bg-white outline-none hover:bg-neutral-50 transition-colors"
|
|
4886
|
+
},
|
|
4887
|
+
/* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Settings03Icon, size: 20, className: "text-black" })
|
|
4888
|
+
), /* @__PURE__ */ import_react81.default.createElement(
|
|
4847
4889
|
"button",
|
|
4848
4890
|
{
|
|
4849
4891
|
onClick: () => {
|
|
@@ -4854,7 +4896,7 @@ var UniversalHome2 = ({
|
|
|
4854
4896
|
},
|
|
4855
4897
|
/* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Notification01Icon, size: 20, className: "text-black" }),
|
|
4856
4898
|
hasUnreadNotifs && /* @__PURE__ */ import_react81.default.createElement("span", { className: "absolute top-2.5 right-2.5 w-2 h-2 bg-red-500 rounded-full border border-white" })
|
|
4857
|
-
)), /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full pb-6 flex flex-col gap-4" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4899
|
+
))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full pb-6 flex flex-col gap-4" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4858
4900
|
"div",
|
|
4859
4901
|
{
|
|
4860
4902
|
onClick: createHuddleAction?.onClick,
|
|
@@ -4866,7 +4908,7 @@ var UniversalHome2 = ({
|
|
|
4866
4908
|
{
|
|
4867
4909
|
src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cal_a.avif",
|
|
4868
4910
|
alt: "Create Huddle",
|
|
4869
|
-
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none
|
|
4911
|
+
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none"
|
|
4870
4912
|
}
|
|
4871
4913
|
)
|
|
4872
4914
|
), /* @__PURE__ */ import_react81.default.createElement(
|
|
@@ -4881,7 +4923,7 @@ var UniversalHome2 = ({
|
|
|
4881
4923
|
{
|
|
4882
4924
|
src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cam_a.avif",
|
|
4883
4925
|
alt: "Join Huddle",
|
|
4884
|
-
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none
|
|
4926
|
+
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none"
|
|
4885
4927
|
}
|
|
4886
4928
|
)
|
|
4887
4929
|
))), customContent && /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full" }, customContent), /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-full mt-2" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
@@ -4889,7 +4931,35 @@ var UniversalHome2 = ({
|
|
|
4889
4931
|
{
|
|
4890
4932
|
...departmentsProps
|
|
4891
4933
|
}
|
|
4892
|
-
)),
|
|
4934
|
+
)), showOrgSwitcher && /* @__PURE__ */ import_react81.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-neutral-100" }, /* @__PURE__ */ import_react81.default.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ import_react81.default.createElement(
|
|
4935
|
+
"button",
|
|
4936
|
+
{
|
|
4937
|
+
key: org.id,
|
|
4938
|
+
onClick: () => {
|
|
4939
|
+
onOrganizationSelect?.(org.id);
|
|
4940
|
+
setShowOrgSwitcher(false);
|
|
4941
|
+
},
|
|
4942
|
+
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-neutral-50 last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
4943
|
+
},
|
|
4944
|
+
/* @__PURE__ */ import_react81.default.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black font-medium" : "text-neutral-600"}` }, org.name),
|
|
4945
|
+
activeOrgId === org.id && /* @__PURE__ */ import_react81.default.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
|
|
4946
|
+
)))))), showNotifDialog && /* @__PURE__ */ import_react81.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ import_react81.default.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.ArrowLeft01Icon, size: 14 }), " Back") : /* @__PURE__ */ import_react81.default.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ import_react81.default.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.CancelCircleIcon, size: 18 }))), /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ import_react81.default.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ import_react81.default.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ import_react81.default.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ import_react81.default.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ import_react81.default.createElement(
|
|
4947
|
+
"button",
|
|
4948
|
+
{
|
|
4949
|
+
onClick: () => handleResolve("ACCEPTED"),
|
|
4950
|
+
disabled: isResolving,
|
|
4951
|
+
className: "flex-1 py-3 rounded-full bg-black text-white text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-800 flex justify-center items-center disabled:opacity-50"
|
|
4952
|
+
},
|
|
4953
|
+
isResolving ? /* @__PURE__ */ import_react81.default.createElement(import_react82.HugeiconsIcon, { icon: import_core_free_icons29.Loading03Icon, className: "animate-spin", size: 16 }) : "Accept"
|
|
4954
|
+
), /* @__PURE__ */ import_react81.default.createElement(
|
|
4955
|
+
"button",
|
|
4956
|
+
{
|
|
4957
|
+
onClick: () => handleResolve("REJECTED"),
|
|
4958
|
+
disabled: isResolving,
|
|
4959
|
+
className: "flex-1 py-3 rounded-full bg-white border border-neutral-200 text-black text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-50 flex justify-center items-center disabled:opacity-50"
|
|
4960
|
+
},
|
|
4961
|
+
"Reject"
|
|
4962
|
+
))) : /* @__PURE__ */ import_react81.default.createElement("div", { className: "flex flex-col divide-y divide-neutral-50/50" }, notifications?.length === 0 && !isNotifsLoading ? /* @__PURE__ */ import_react81.default.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "You have no notifications.") : notifications?.map((notif) => /* @__PURE__ */ import_react81.default.createElement(
|
|
4893
4963
|
"div",
|
|
4894
4964
|
{
|
|
4895
4965
|
key: notif.id,
|
package/dist/index.mjs
CHANGED
|
@@ -527,7 +527,7 @@ function AuthFormInner({
|
|
|
527
527
|
onKeyDown: (e) => {
|
|
528
528
|
if (e.key === "Backspace" && !otp[index] && index > 0) inputRefs.current[index - 1]?.focus();
|
|
529
529
|
},
|
|
530
|
-
className: "w-10 h-
|
|
530
|
+
className: "w-10 h-10 text-center text-sm bg-transparent border-b-2 border-neutral-200 text-black outline-none focus:border-black transition-all duration-300"
|
|
531
531
|
}
|
|
532
532
|
))), /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React5.createElement(ThreeDActionButton, { type: "submit", disabled: otp.join("").length < 6, isLoading: isSubmitting, className: "w-full" }, "Verify Code"), !userHas2FA && /* @__PURE__ */ React5.createElement(
|
|
533
533
|
"button",
|
|
@@ -4832,17 +4832,23 @@ var UniversalMembersPage = ({
|
|
|
4832
4832
|
import React48, { useState as useState33 } from "react";
|
|
4833
4833
|
import { useRouter as useRouter3 } from "next/navigation";
|
|
4834
4834
|
import { HugeiconsIcon as HugeiconsIcon34 } from "@hugeicons/react";
|
|
4835
|
+
import toast13 from "react-hot-toast";
|
|
4835
4836
|
import {
|
|
4836
4837
|
Loading03Icon as Loading03Icon22,
|
|
4837
4838
|
Notification01Icon as Notification01Icon2,
|
|
4838
4839
|
ArrowLeft01Icon as ArrowLeft01Icon15,
|
|
4839
4840
|
ArrowRight01Icon as ArrowRight01Icon11,
|
|
4840
4841
|
CancelCircleIcon as CancelCircleIcon9,
|
|
4841
|
-
ArrowUpRight01Icon as ArrowUpRight01Icon3
|
|
4842
|
+
ArrowUpRight01Icon as ArrowUpRight01Icon3,
|
|
4843
|
+
Settings03Icon
|
|
4842
4844
|
} from "@hugeicons/core-free-icons";
|
|
4843
4845
|
var UniversalHome2 = ({
|
|
4844
|
-
fullName = "",
|
|
4845
4846
|
avatarSrc,
|
|
4847
|
+
userStatus = "ACTIVE",
|
|
4848
|
+
organizations = [],
|
|
4849
|
+
activeOrgId,
|
|
4850
|
+
onOrganizationSelect,
|
|
4851
|
+
barIcons = [],
|
|
4846
4852
|
createHuddleAction,
|
|
4847
4853
|
joinHuddleAction,
|
|
4848
4854
|
notifications = [],
|
|
@@ -4851,18 +4857,48 @@ var UniversalHome2 = ({
|
|
|
4851
4857
|
isNotifsLoading = false,
|
|
4852
4858
|
onNotificationPageChange,
|
|
4853
4859
|
onNotificationClick,
|
|
4860
|
+
onResolveInvite,
|
|
4854
4861
|
formatNotifDate,
|
|
4855
4862
|
customContent,
|
|
4856
4863
|
departmentsProps
|
|
4857
4864
|
}) => {
|
|
4858
4865
|
const [isAvatarLoaded, setIsAvatarLoaded] = useState33(false);
|
|
4859
4866
|
const [showNotifDialog, setShowNotifDialog] = useState33(false);
|
|
4867
|
+
const [showOrgSwitcher, setShowOrgSwitcher] = useState33(false);
|
|
4860
4868
|
const [selectedNotif, setSelectedNotif] = useState33(null);
|
|
4869
|
+
const [isResolving, setIsResolving] = useState33(false);
|
|
4861
4870
|
const router = useRouter3();
|
|
4862
4871
|
const fallbackAvatarUrl = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
|
|
4863
4872
|
const finalAvatarSrc = avatarSrc || fallbackAvatarUrl;
|
|
4864
4873
|
const hasUnreadNotifs = notifications.some((n) => !n.isRead);
|
|
4865
|
-
|
|
4874
|
+
const getDisplayStatus = () => {
|
|
4875
|
+
if (userStatus === "ACTIVE") return "Online";
|
|
4876
|
+
if (userStatus === "BUSY") return "Busy";
|
|
4877
|
+
if (userStatus === "OFFLINE") return "Offline";
|
|
4878
|
+
if (userStatus === "AWAY") return "Away";
|
|
4879
|
+
return "Online";
|
|
4880
|
+
};
|
|
4881
|
+
const getStatusColor = () => {
|
|
4882
|
+
if (userStatus === "ACTIVE") return "bg-emerald-500";
|
|
4883
|
+
if (userStatus === "BUSY") return "bg-amber-500";
|
|
4884
|
+
if (userStatus === "OFFLINE") return "bg-rose-500";
|
|
4885
|
+
if (userStatus === "AWAY") return "bg-neutral-400";
|
|
4886
|
+
return "bg-emerald-500";
|
|
4887
|
+
};
|
|
4888
|
+
const handleResolve = async (resolution) => {
|
|
4889
|
+
if (!onResolveInvite || !selectedNotif) return;
|
|
4890
|
+
setIsResolving(true);
|
|
4891
|
+
try {
|
|
4892
|
+
await onResolveInvite(selectedNotif, resolution);
|
|
4893
|
+
setShowNotifDialog(false);
|
|
4894
|
+
setSelectedNotif(null);
|
|
4895
|
+
} catch (error) {
|
|
4896
|
+
toast13.error("Failed to process invitation");
|
|
4897
|
+
} finally {
|
|
4898
|
+
setIsResolving(false);
|
|
4899
|
+
}
|
|
4900
|
+
};
|
|
4901
|
+
return /* @__PURE__ */ React48.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ React48.createElement("div", { className: "w-10 h-10 shrink-0 cursor-pointer", onClick: () => setShowOrgSwitcher(true) }, /* @__PURE__ */ React48.createElement("div", { className: "relative w-full h-full rounded-lg overflow-hidden bg-white flex items-center justify-center" }, !isAvatarLoaded && /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 flex items-center justify-center z-10 bg-white" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 16, className: "animate-spin text-black" })), /* @__PURE__ */ React48.createElement(
|
|
4866
4902
|
"img",
|
|
4867
4903
|
{
|
|
4868
4904
|
src: finalAvatarSrc,
|
|
@@ -4870,7 +4906,14 @@ var UniversalHome2 = ({
|
|
|
4870
4906
|
onLoad: () => setIsAvatarLoaded(true),
|
|
4871
4907
|
className: `w-full h-full object-cover transition-opacity duration-300 ${isAvatarLoaded ? "opacity-100" : "opacity-0"}`
|
|
4872
4908
|
}
|
|
4873
|
-
))), /* @__PURE__ */ React48.createElement(
|
|
4909
|
+
))), /* @__PURE__ */ React48.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React48.createElement(
|
|
4910
|
+
"button",
|
|
4911
|
+
{
|
|
4912
|
+
onClick: () => router.push("/app/settings"),
|
|
4913
|
+
className: "relative w-10 h-10 flex items-center justify-center rounded-full bg-white outline-none hover:bg-neutral-50 transition-colors"
|
|
4914
|
+
},
|
|
4915
|
+
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Settings03Icon, size: 20, className: "text-black" })
|
|
4916
|
+
), /* @__PURE__ */ React48.createElement(
|
|
4874
4917
|
"button",
|
|
4875
4918
|
{
|
|
4876
4919
|
onClick: () => {
|
|
@@ -4881,7 +4924,7 @@ var UniversalHome2 = ({
|
|
|
4881
4924
|
},
|
|
4882
4925
|
/* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Notification01Icon2, size: 20, className: "text-black" }),
|
|
4883
4926
|
hasUnreadNotifs && /* @__PURE__ */ React48.createElement("span", { className: "absolute top-2.5 right-2.5 w-2 h-2 bg-red-500 rounded-full border border-white" })
|
|
4884
|
-
)), /* @__PURE__ */ React48.createElement("div", { className: "w-full pb-6 flex flex-col gap-4" }, /* @__PURE__ */ React48.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ React48.createElement(
|
|
4927
|
+
))), /* @__PURE__ */ React48.createElement("div", { className: "w-full pb-6 flex flex-col gap-4" }, /* @__PURE__ */ React48.createElement("div", { className: "grid grid-cols-2 gap-2" }, /* @__PURE__ */ React48.createElement(
|
|
4885
4928
|
"div",
|
|
4886
4929
|
{
|
|
4887
4930
|
onClick: createHuddleAction?.onClick,
|
|
@@ -4893,7 +4936,7 @@ var UniversalHome2 = ({
|
|
|
4893
4936
|
{
|
|
4894
4937
|
src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cal_a.avif",
|
|
4895
4938
|
alt: "Create Huddle",
|
|
4896
|
-
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none
|
|
4939
|
+
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none"
|
|
4897
4940
|
}
|
|
4898
4941
|
)
|
|
4899
4942
|
), /* @__PURE__ */ React48.createElement(
|
|
@@ -4908,7 +4951,7 @@ var UniversalHome2 = ({
|
|
|
4908
4951
|
{
|
|
4909
4952
|
src: "https://storage.googleapis.com/retina-cloud-v2/assets/images/cam_a.avif",
|
|
4910
4953
|
alt: "Join Huddle",
|
|
4911
|
-
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none
|
|
4954
|
+
className: "absolute bottom-4 right-2 translate-x-1/4 translate-y-1/2 w-32 h-auto object-contain z-0 pointer-events-none"
|
|
4912
4955
|
}
|
|
4913
4956
|
)
|
|
4914
4957
|
))), customContent && /* @__PURE__ */ React48.createElement("div", { className: "w-full" }, customContent), /* @__PURE__ */ React48.createElement("div", { className: "w-full mt-2" }, /* @__PURE__ */ React48.createElement(
|
|
@@ -4916,7 +4959,35 @@ var UniversalHome2 = ({
|
|
|
4916
4959
|
{
|
|
4917
4960
|
...departmentsProps
|
|
4918
4961
|
}
|
|
4919
|
-
)),
|
|
4962
|
+
)), showOrgSwitcher && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowOrgSwitcher(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-auto max-h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-neutral-100" }, /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight" }, "Switch Workspace"), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowOrgSwitcher(false), className: "text-neutral-400 hover:text-black transition-colors outline-none" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon9, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col" }, organizations?.length === 0 ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "No organizations found.") : organizations?.map((org) => /* @__PURE__ */ React48.createElement(
|
|
4963
|
+
"button",
|
|
4964
|
+
{
|
|
4965
|
+
key: org.id,
|
|
4966
|
+
onClick: () => {
|
|
4967
|
+
onOrganizationSelect?.(org.id);
|
|
4968
|
+
setShowOrgSwitcher(false);
|
|
4969
|
+
},
|
|
4970
|
+
className: `p-4 flex items-center justify-between gap-3 cursor-pointer outline-none transition-colors border-b border-neutral-50 last:border-0 ${activeOrgId === org.id ? "bg-neutral-50" : "hover:bg-neutral-50/50"}`
|
|
4971
|
+
},
|
|
4972
|
+
/* @__PURE__ */ React48.createElement("span", { className: `text-[13px] tracking-tight ${activeOrgId === org.id ? "text-black font-medium" : "text-neutral-600"}` }, org.name),
|
|
4973
|
+
activeOrgId === org.id && /* @__PURE__ */ React48.createElement("div", { className: "w-2 h-2 rounded-full bg-emerald-500" })
|
|
4974
|
+
)))))), showNotifDialog && /* @__PURE__ */ React48.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React48.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowNotifDialog(false) }), /* @__PURE__ */ React48.createElement("div", { className: "relative w-full max-w-sm bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React48.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, selectedNotif ? /* @__PURE__ */ React48.createElement("button", { onClick: () => setSelectedNotif(null), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none flex items-center gap-2 text-[11px] tracking-widest disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: ArrowLeft01Icon15, size: 14 }), " Back") : /* @__PURE__ */ React48.createElement("h3", { className: "text-[15px] text-black tracking-tight flex items-center gap-2" }, "Notifications", isNotifsLoading && /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, size: 14, className: "animate-spin text-neutral-400" })), /* @__PURE__ */ React48.createElement("button", { onClick: () => setShowNotifDialog(false), disabled: isResolving, className: "text-neutral-400 hover:text-black transition-colors outline-none disabled:opacity-50" }, /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: CancelCircleIcon9, size: 18 }))), /* @__PURE__ */ React48.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, selectedNotif ? /* @__PURE__ */ React48.createElement("div", { className: "p-4 text-left" }, /* @__PURE__ */ React48.createElement("h4", { className: "text-[14px] text-black mb-1" }, selectedNotif.title), /* @__PURE__ */ React48.createElement("span", { className: "text-[10px] text-neutral-400 tracking-widest mb-4 block" }, formatNotifDate(selectedNotif.createdAt)), /* @__PURE__ */ React48.createElement("p", { className: "text-[12px] text-neutral-600 leading-relaxed whitespace-pre-wrap" }, selectedNotif.message), selectedNotif.type === "HUDDLE_INVITE" && selectedNotif.meta_json?.action === "RESOLVE_INVITE" && /* @__PURE__ */ React48.createElement("div", { className: "mt-8 flex gap-3 pt-6 border-t border-neutral-100" }, /* @__PURE__ */ React48.createElement(
|
|
4975
|
+
"button",
|
|
4976
|
+
{
|
|
4977
|
+
onClick: () => handleResolve("ACCEPTED"),
|
|
4978
|
+
disabled: isResolving,
|
|
4979
|
+
className: "flex-1 py-3 rounded-full bg-black text-white text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-800 flex justify-center items-center disabled:opacity-50"
|
|
4980
|
+
},
|
|
4981
|
+
isResolving ? /* @__PURE__ */ React48.createElement(HugeiconsIcon34, { icon: Loading03Icon22, className: "animate-spin", size: 16 }) : "Accept"
|
|
4982
|
+
), /* @__PURE__ */ React48.createElement(
|
|
4983
|
+
"button",
|
|
4984
|
+
{
|
|
4985
|
+
onClick: () => handleResolve("REJECTED"),
|
|
4986
|
+
disabled: isResolving,
|
|
4987
|
+
className: "flex-1 py-3 rounded-full bg-white border border-neutral-200 text-black text-[12px] tracking-wide transition-all outline-none hover:bg-neutral-50 flex justify-center items-center disabled:opacity-50"
|
|
4988
|
+
},
|
|
4989
|
+
"Reject"
|
|
4990
|
+
))) : /* @__PURE__ */ React48.createElement("div", { className: "flex flex-col divide-y divide-neutral-50/50" }, notifications?.length === 0 && !isNotifsLoading ? /* @__PURE__ */ React48.createElement("div", { className: "p-8 text-center text-xs text-neutral-400" }, "You have no notifications.") : notifications?.map((notif) => /* @__PURE__ */ React48.createElement(
|
|
4920
4991
|
"div",
|
|
4921
4992
|
{
|
|
4922
4993
|
key: notif.id,
|