/* Copyright 2026 Marimo. All rights reserved. */ /* oxlint-disable react/jsx-no-comment-textnodes */ /* oxlint-disable react/jsx-no-target-blank */ import { useAtomValue } from "jotai"; import { CopyIcon, DownloadIcon } from "lucide-react"; import type React from "react"; import { Constants } from "@/core/constants"; import { codeAtom } from "@/core/saving/file-state"; import { useFilename } from "@/core/saving/filename"; import { isStaticNotebook } from "@/core/static/static-state"; import { createShareableLink } from "@/core/wasm/share"; import { copyToClipboard } from "@/utils/copy"; import { downloadBlob } from "@/utils/download"; import { Button } from "../ui/button"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "../ui/dialog"; import { toast } from "../ui/use-toast"; import { MarimoPlusIcon } from "../icons/marimo-icons"; export const StaticBanner: React.FC = () => { const code = useAtomValue(codeAtom); if (!isStaticNotebook()) { return null; } if (!code) { return null; } return (
Static{" "} marimo {" "} notebook - Run or edit for full interactivity
); }; const StaticBannerDialog = ({ code }: { code: string }) => { let filename = useFilename() || "notebook.py"; // Trim the path const lastSlash = filename.lastIndexOf("/"); if (lastSlash !== -1) { filename = filename.slice(lastSlash + 1); } const href = window.location.href; const molabLink = createShareableLink({ code, baseUrl: `${Constants.molab}/new`, }); return ( {filename}

This is a static{" "} marimo {" "} notebook. To run interactively:

pip install marimo
marimo edit {filename}
{!href.endsWith(".html") && (
Or run directly from URL:
marimo edit {window.location.href}
)}

Run this notebook in{" "} molab, marimo's cloud-hosted notebook platform.

); };