20 lines
458 B
Plaintext
20 lines
458 B
Plaintext
---
|
|
import renderPicture from "../api/renderPicture.js";
|
|
import type { PictureConfigOptions } from "../types.d";
|
|
|
|
declare interface Props extends PictureConfigOptions {
|
|
s?: string;
|
|
}
|
|
|
|
const { s, ...rest } = Astro.props as Props;
|
|
|
|
if (s) {
|
|
const separator = rest.src.includes("?") ? "&" : "?";
|
|
rest.src = `${rest.src}${separator}s=${s}`;
|
|
}
|
|
|
|
const { link, style, picture } = await renderPicture(rest);
|
|
---
|
|
|
|
<Fragment set:html={link + style + picture} />
|