diff --git a/site/src/components/typography/Img.astro b/site/src/components/typography/Img.astro index d96116c9..6bbe5a5b 100644 --- a/site/src/components/typography/Img.astro +++ b/site/src/components/typography/Img.astro @@ -5,8 +5,16 @@ import type { ComponentProps } from 'astro/types'; import { twMerge } from '@/utils/twMerge'; type Props = ComponentProps; -const { class: className, ...rest } = Astro.props; +const { class: className, src, ...rest } = Astro.props; + +const isRemote = typeof src === 'string' && src.startsWith('http'); --- -{/* @ts-expect-error tbh I don't know how to tell ts that inferSize is ok */} - +{ + isRemote ? ( + + ) : ( + // @ts-expect-error tbh I don't know how to tell ts that inferSize is ok + + ) +}