"use client" import type { ReactNode } from "react" import Link from "next/link" import { ArrowLeft, Globe, Lock, Users } from "lucide-react" import { EditorAccountButton } from "@/components/drive/editor-account-button" import { OfficeEditorInlineTitle } from "@/components/drive/office-editor-inline-title" import { ShareDialog } from "@/components/drive/share-dialog" import { Button } from "@/components/ui/button" import type { DriveShare } from "@/lib/api/types" import { resolveShareButtonIcon, type ShareButtonIcon, } from "@/lib/drive/drive-share-button-state" import { cn } from "@/lib/utils" function ShareButtonIcon({ kind }: { kind: ShareButtonIcon }) { if (kind === "globe") return if (kind === "users") return return } export function OfficeEditorChrome({ backHref, backLabel, title, showBack = true, onRename, renameDisabled = false, shares = [], onShareClick, showShare = false, showAccount = false, trailing, }: { backHref?: string backLabel?: string title: string showBack?: boolean onRename?: (next: string) => Promise renameDisabled?: boolean shares?: DriveShare[] onShareClick?: () => void showShare?: boolean showAccount?: boolean trailing?: React.ReactNode }) { const shareIcon = resolveShareButtonIcon(shares) return ( <>
{showBack && backHref ? ( ) : null}
{onRename ? ( ) : ( {title} )}
{trailing} {showShare ? ( ) : null} {showAccount ? : null}
{showShare ? : null} ) }