import React from 'react'; import { Box, Typography, alpha, useTheme } from '@mui/material'; import { useTranslation } from 'react-i18next'; interface StatusBadgeProps { isLegacy?: boolean; isAvailable?: boolean; size?: 'small' | 'medium'; sx?: any; } const sizeMap = { small: { px: 0.85, py: 0.3, dot: 5, font: '0.55rem', gap: 0.5 }, medium: { px: 1.1, py: 0.45, dot: 6, font: '0.65rem', gap: 0.6 }, } as const; const StatusBadge: React.FC = ({ isLegacy, isAvailable, size = 'medium', sx, }) => { const theme = useTheme(); const { t } = useTranslation(); if (isAvailable && !isLegacy) return null; const dims = sizeMap[size]; const accent = isLegacy ? theme.palette.warning.main : theme.palette.error.main; const label = isLegacy ? t('status.limited', { defaultValue: 'Limited' }) : t('status.outOfStock', { defaultValue: 'Out of Stock' }); const isLight = theme.palette.mode === 'light'; const surface = alpha(theme.palette.background.paper, isLight ? 0.85 : 0.55); return ( {label} ); }; export default StatusBadge;