'use client'; interface SaveBarProps { dirty: boolean; saving: boolean; saveMessage: string; onSave: () => void; label: string; /** Show the cache-bypassing preview link (page builder only). */ showPreview?: boolean; } /** * Floating save bar pinned to the bottom of the viewport. * * It only mounts while there is something to act on (unsaved changes, an * in-flight save, or a result message) so it never covers content otherwise. * The success message is cleared by the caller after a few seconds, which * makes the bar disappear on its own. */ export default function SaveBar({ dirty, saving, saveMessage, onSave, label, showPreview = false, }: SaveBarProps) { if (!dirty && !saving && !saveMessage) return null; return (
{saveMessage ? ( {saveMessage} ) : ( )}
{showPreview && ( ↗ Preview Site )}
); }