/** * Sandbox Banner Component * Displays a prominent warning banner when in test/sandbox mode */ import React from 'react'; import { useTranslation } from 'react-i18next'; import { FlaskConical, X } from 'lucide-react'; interface SandboxBannerProps { /** Whether sandbox mode is currently active */ isSandbox: boolean; /** Callback to switch to live mode */ onSwitchToLive: () => void; /** Optional: Allow dismissing the banner (it will reappear on page reload) */ onDismiss?: () => void; /** Whether switching is in progress */ isSwitching?: boolean; } const SandboxBanner: React.FC = ({ isSandbox, onSwitchToLive, onDismiss, isSwitching = false, }) => { const { t } = useTranslation(); // Don't render if not in sandbox mode if (!isSandbox) { return null; } return (
{t('sandbox.bannerTitle', 'TEST MODE')} {t('sandbox.bannerDescription', 'You are viewing test data. Changes here won\'t affect your live business.')}
{onDismiss && ( )}
); }; export default SandboxBanner;