summaryrefslogtreecommitdiff
path: root/packages/integrations/image/components/Picture.astro
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/image/components/Picture.astro')
-rw-r--r--packages/integrations/image/components/Picture.astro46
1 files changed, 0 insertions, 46 deletions
diff --git a/packages/integrations/image/components/Picture.astro b/packages/integrations/image/components/Picture.astro
deleted file mode 100644
index bdaaceae0..000000000
--- a/packages/integrations/image/components/Picture.astro
+++ /dev/null
@@ -1,46 +0,0 @@
----
-import { getPicture } from '../dist/index.js';
-import { warnForMissingAlt } from './index.js';
-import type { PictureComponentLocalImageProps, PictureComponentRemoteImageProps } from './index.js';
-import type { GetPictureResult } from '../src/lib/get-picture.js';
-
-export type Props = PictureComponentLocalImageProps | PictureComponentRemoteImageProps;
-
-const {
- src,
- alt,
- sizes,
- widths,
- aspectRatio,
- fit,
- background,
- position,
- formats = ['avif', 'webp'],
- loading = 'lazy',
- decoding = 'async',
- ...attrs
-} = Astro.props;
-
-if (alt === undefined || alt === null) {
- warnForMissingAlt();
-}
-
-const { image, sources }: GetPictureResult = await getPicture({
- src,
- widths,
- formats,
- aspectRatio,
- fit,
- background,
- position,
- alt,
-});
-
-delete image.width;
-delete image.height;
----
-
-<picture>
- {sources.map((attrs) => <source {...attrs} {sizes} />)}
- <img {...image} {loading} {decoding} {...attrs} />
-</picture>