import React from 'react';
import { Chip } from '@mui/material';

export type ChipColor = 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';

export interface StatusChipProps {
  status: string;
  colorMap: Record<string, ChipColor>;
  labelMap: Record<string, string>;
  size?: 'small' | 'medium';
  variant?: 'filled' | 'outlined';
  icon?: React.ReactElement;
}

/** Consistent status chip with configurable color and label maps. */
export const StatusChip: React.FC<StatusChipProps> = ({
  status,
  colorMap,
  labelMap,
  size = 'small',
  variant = 'filled',
  icon,
}) => {
  return (
    <Chip
      label={labelMap[status] || status}
      color={colorMap[status] || 'default'}
      size={size}
      variant={variant}
      icon={icon}
    />
  );
};
