()
| 25 | import { DownloadDropdown } from "./DownloadDropdown"; |
| 26 | |
| 27 | export function FlowchartHeader() { |
| 28 | const title = useDocDetails("title", "flowchart.fun"); |
| 29 | const { setShareModal } = useContext(AppContext); |
| 30 | const isReadOnly = useIsReadOnly(); |
| 31 | const hasProAccess = useHasProAccess(); |
| 32 | const pageTitle = title || "flowchart.fun"; |
| 33 | const isSandbox = useLocation().pathname === "/"; |
| 34 | return ( |
| 35 | <> |
| 36 | <Helmet> |
| 37 | <title>{`${pageTitle} - Flowchart Fun`}</title> |
| 38 | </Helmet> |
| 39 | <header |
| 40 | className={classNames( |
| 41 | styles.HeaderTitle, |
| 42 | "grid gap-2 md:flex items-end justify-between p-4 md:p-2 md:mb-2" |
| 43 | )} |
| 44 | > |
| 45 | {isSandbox ? ( |
| 46 | <div className="grid gap-0.5 content-end"> |
| 47 | <FlowchartTitle title={title}>{pageTitle}</FlowchartTitle> |
| 48 | <p className="text-xs text-neutral-500 dark:text-neutral-300/80 font-medium leading-tight text-wrap-pretty"> |
| 49 | <Trans> |
| 50 | Create flowcharts instantly: Type or paste text, see it |
| 51 | visualized. |
| 52 | </Trans> |
| 53 | </p> |
| 54 | </div> |
| 55 | ) : ( |
| 56 | <RenameButton key={pageTitle}> |
| 57 | <FlowchartTitle title={title}>{pageTitle}</FlowchartTitle> |
| 58 | </RenameButton> |
| 59 | )} |
| 60 | |
| 61 | <div className="flex items-center gap-1"> |
| 62 | {isReadOnly && ( |
| 63 | <span className="text-xs text-neutral-400 dark:text-neutral-600 font-extrabold uppercase tracking-tight"> |
| 64 | <Trans>Read-only</Trans> |
| 65 | </span> |
| 66 | )} |
| 67 | {isReadOnly && hasProAccess ? <CloneButton /> : null} |
| 68 | {!isReadOnly ? ( |
| 69 | <> |
| 70 | {isSandbox ? <SaveButton /> : null} |
| 71 | <ShareDialog> |
| 72 | <Button2 |
| 73 | onClick={() => setShareModal(true)} |
| 74 | leftIcon={<Share weight="bold" className="w-4 h-4" />} |
| 75 | aria-label="Export" |
| 76 | data-session-activity="Share Chart" |
| 77 | > |
| 78 | <Trans>Share</Trans> |
| 79 | </Button2> |
| 80 | </ShareDialog> |
| 81 | </> |
| 82 | ) : null} |
| 83 | <DownloadDropdown> |
| 84 | <Button2 |
nothing calls this directly
no test coverage detected