// The sticky save bar every draft-editing page shares: slides up when the draft goes // dirty, pins to the viewport bottom, offers Save + Discard. import { AnimatedButton, Button } from "@unom/ui/button"; import { Spinner } from "@unom/ui/spinner"; import { AnimatePresence, motion } from "motion/react"; export type SaveBarProps = { readonly dirty: boolean; readonly saving: boolean; readonly onSave: () => void; readonly onDiscard: () => void; }; export const SaveBar = ({ dirty, saving, onSave, onDiscard }: SaveBarProps) => ( {dirty ? (
Unsaved changes
{/* variants={{}} neutralizes the button's Section-stagger entry variants — inside this object-form motion wrapper the `enter` label never propagates, which would leave the button stuck at opacity 0. */} {saving ? : null} Save changes
) : null}
);