all repos — snow-editor @ 13d855e25e8510a57608b0ce77f62cbeed372d0e

small and cozy markdown, and orgmode editor

src/components/SaveStatus.jsx (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
import { STR } from '../lib/strings.js';

const LABELS = {
  idle: '',
  saving: STR.SAVE_SAVING,
  saved: STR.SAVE_SAVED,
  error: STR.SAVE_ERROR,
  no_permission: STR.SAVE_NO_PERMISSION,
};

export default function SaveStatus({ status }) {
  const label = LABELS[status];
  if (!label) return null;
  return (
    <span className={`save-status save-status--${status}`} role="status">
      {label}
    </span>
  );
}