import Box from "@mui/material/Box";
import type { SxProps, Theme } from "@mui/material/styles";

type DashboardAssetIconProps = {
  src: string;
  alt?: string;
  width?: number | string;
  height?: number | string;
  size?: number | string;
  sx?: SxProps<Theme>;
};

export function DashboardAssetIcon({
  src,
  alt = "",
  width,
  height,
  size,
  sx,
}: DashboardAssetIconProps) {
  return (
    <Box
      component="img"
      src={src}
      alt={alt}
      sx={{
        display: "block",
        width: size ?? width,
        height: size ?? height,
        flexShrink: 0,
        ...sx,
      }}
    />
  );
}
