mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
fix: type warnings in Picture component
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
---
|
---
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
|
|
||||||
import { Picture } from 'astro-imagetools/components';
|
import { Picture as AstroImageToolsPicture } from 'astro-imagetools/components';
|
||||||
import type { PictureConfigOptions } from 'astro-imagetools';
|
import type { PictureConfigOptions } from 'astro-imagetools';
|
||||||
|
|
||||||
interface Props extends PictureConfigOptions {
|
interface Props extends PictureConfigOptions {
|
||||||
|
alt: string;
|
||||||
|
aspect: number;
|
||||||
|
breakpoints?: number[];
|
||||||
class?: string;
|
class?: string;
|
||||||
noMargin?: boolean;
|
noMargin?: boolean;
|
||||||
src: string;
|
src: string;
|
||||||
@@ -24,7 +27,12 @@ const classes = cx(
|
|||||||
src.includes('.svg') ? (
|
src.includes('.svg') ? (
|
||||||
<img src={src} {...(props as any)} />
|
<img src={src} {...(props as any)} />
|
||||||
) : (
|
) : (
|
||||||
<Picture breakpoints={[500, 1000, 1500]} format={['avif']} src={src} {...props} />
|
<AstroImageToolsPicture
|
||||||
|
breakpoints={[500, 1000, 1500]}
|
||||||
|
format={['avif']}
|
||||||
|
src={src}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user