EmailImage.tsx 806 B

123456789101112131415161718192021
  1. import ResponsiveImage from '@/components/ResponsiveImage';
  2. export default function EmailImage({ email, dark = false, full = false, ...props }) {
  3. const width = full ? email.widthFull : email.width;
  4. const height = full ? email.heightFull : email.height;
  5. return (
  6. <ResponsiveImage
  7. src={`/img/tabler-emails/screenshots/${email.screenshot}${dark ? '-dark' : ''}${full ? '-full' : ''}.png`}
  8. width={width}
  9. height={height}
  10. {...props}
  11. />
  12. );
  13. // return (
  14. // <div className="rounded bg-white border-light" style={{ position: 'relative', paddingTop: `${height / width * 100}%`, overflow: 'hidden'}}>
  15. // <div style={{ background: `url() no-repeat top center/cover`, position: 'absolute', top: -2, left: -2, right: -2, bottom: -2 }} />
  16. // </div>
  17. // )
  18. }