import { useRef, type ReactNode } from "react"; import { Globe2, Share2, Users } from "lucide-react"; import { DropdownPortal } from "@/client/components/ui/dropdown-portal"; import { Skeleton } from "@/client/components/ui/skeleton"; import type { ShareDialogAffordance } from "@/client/lib/affordance/share-dialog"; import { useShareDialogShell } from "./context"; import { PublishTabContent } from "./publish-tab"; import { ShareLinkSection, SharePeopleSection } from "./share-tab"; import type { DialogTab } from "./types"; export function ShareDialogShell() { const { disabled, title, open, close, toggleOpen, loading, error, dialogAffordance, publishAffordance, activeTab, setActiveTab, } = useShareDialogShell(); const triggerRef = useRef(null); const showPublishTab = publishAffordance.showPublishTab; return ( <> {open && !disabled && ( {showPublishTab && (
Share Publish
)} {activeTab === "share" || !showPublishTab ? ( ) : ( )}
)} ); } function DialogTabButton({ tab, active, onSelect, children, }: { tab: DialogTab; active: boolean; onSelect: (tab: DialogTab) => void; children: ReactNode; }) { return ( ); } function ShareTabContent({ loading, error, dialogAffordance, }: { loading: boolean; error: string | null; dialogAffordance: ShareDialogAffordance; }) { if (loading) { return (
); } return ( <> {error &&

{error}

} {dialogAffordance.showPeopleSection && } {dialogAffordance.showLinkSection && } ); }