diff --git a/src/components/Image.astro b/src/components/Image.astro index 8425f21..c7ff86e 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -1,40 +1,68 @@ --- -const { src, alt, nsfw } = Astro.props; +const { src, alt, nsfw, artist } = Astro.props; +const showNsfw = Astro.url.searchParams.has('nsfw') || false; --- -
-
- {alt} - { - alt && ( +
+ { (nsfw && showNsfw) ? ( +
+
+ {`${alt` : ""} ${artist ? `by ${artist}` : ""}`} loading="lazy" /> + { + alt && ( +
+ {alt} +
+ ) + } +
+
+ ): null } + + { !nsfw ? ( +
- {alt} + {`${alt` : ""} ${artist ? `by ${artist}` : ""}`} loading="lazy" /> + { + alt && ( +
+ {alt} +
+ ) + }
- ) - } -
+
+ ): null } +