all repos — snow-editor @ 24ce9e9ef60be3233adb8eaa03f5a936c1ef4acd

small and cozy markdown, and orgmode editor

src/components/ReadOnlyBanner.jsx (view raw)

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

export default function ReadOnlyBanner({ message, lockExpiresAt, variant = 'info' }) {
  const expiry = formatLockExpiry(lockExpiresAt);

  return (
    <div className={`alert-banner alert-banner--${variant}`} role="status">
      <p>{message}</p>
      {expiry && (
        <p className="alert-banner__meta">
          {STR.LOCK_EXPIRES_AT}: {expiry}
        </p>
      )}
    </div>
  );
}