@@ -5,14 +5,14 @@ import * as Styles from "./style";
55import { colorIntToRgba } from "../../utils/colorIntToCss" ;
66import moment from "moment" ;
77import { LinkMarkdown , parseEmbedTitle } from "../../markdown/render" ;
8- import useSize from "./useSize" ;
98import EmbedVideo from "./EmbedVideo" ;
109import React , { useMemo } from "react" ;
1110import type { APIEmbed , APIEmbedImage } from "discord-api-types/v10" ;
1211import { EmbedType } from "discord-api-types/v10" ;
1312import EmbeddedImage from "./EmbeddedImage" ;
1413import ExternalLink from "../../ExternalLink" ;
1514import { error } from "../../utils/error" ;
15+ import useSize from "src/Content/Embed/useSize" ;
1616
1717export interface EmbedProps {
1818 embed : APIEmbed ;
@@ -38,7 +38,7 @@ function Embed({ embed, images }: EmbedProps) {
3838 ? colorIntToRgba ( embed . color )
3939 : undefined ;
4040
41- const { width : widthImage , height : heightImage } = useSize (
41+ const { width : widthImage } = useSize (
4242 embed . type ,
4343 embed . image ,
4444 "EmbedImage" ,
@@ -140,8 +140,11 @@ function Embed({ embed, images }: EmbedProps) {
140140 { ( images === undefined || images ?. length === 0 ) && embed . image && (
141141 < EmbeddedImage
142142 embedImage = { embed . image }
143- width = { widthImage ?? undefined }
144- height = { heightImage ?? undefined }
143+ withMargin
144+ image = { embed . image }
145+ width = { embed . image . width }
146+ height = { embed . image . height }
147+ type = "EmbedImage"
145148 />
146149 ) }
147150 { images && images . length > 0 && (
0 commit comments