Files
factorio-clusterio/packages/web_ui/src/components/UnsavedChangesBar.tsx
T
bbassieandClaude Opus 5.5 a6b44e78d6 Tidy up web interface buttons and labels
Rename save Copy to Duplicate, shorten the save buttons, move Load
scenario into the instance control button and Create template into
More, square off the online players table, show the bind address and
public URL on the controller page, restyle the user settings like the
role page, add a favicon with a controller.favicon_url override, and
put the page name in the tab title.

Closes #1260

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:03:02 +00:00

41 lines
876 B
TypeScript

import React from "react";
import { Button, Space } from "antd";
type UnsavedChangesBarProps = {
onRevert: () => void;
onApply: () => void;
applying?: boolean;
};
/** Floating bar shown while a page has edits that are not applied yet */
export default function UnsavedChangesBar(props: UnsavedChangesBarProps) {
return <div style={{
position: "fixed",
bottom: 24,
left: "50%",
transform: "translateX(-50%)",
background: "#2a1912",
borderRadius: 8,
boxShadow: "0 8px 24px rgba(0,0,0,0.12)",
padding: "10px 14px",
display: "flex",
alignItems: "center",
gap: 12,
zIndex: 1000,
}}>
<span style={{ color: "#FFF" }}>
You have unsaved changes
</span>
<Space>
<Button onClick={props.onRevert}>
Revert
</Button>
<Button type="primary" loading={props.applying} onClick={props.onApply}>
Apply
</Button>
</Space>
</div>;
}