Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3569 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React from 'react';
import { CardMedia as MuiCardMedia } from '@mui/material';

const MEDIA_TYPES = {
  image: 'img',
  video: 'video',
  audio: 'audio'
};

export function CardMedia({
  src = '',
  height,
  width,
  alt = '',
  type = 'image',
  styles = {
    objectFit: 'contain'
  },
  ...props
}) {
  return (
    <MuiCardMedia
      image={src}
      alt={alt}
      width={width}
      height={height}
      sx={styles}
      component={MEDIA_TYPES[type] ?? MEDIA_TYPES.image}
      {...props}
    />
  );
}