fix: fix middlewares config
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import type { ComponentProps } from "react";
|
||||
import { type ComponentProps } from "react";
|
||||
|
||||
export type ImgProps = Omit<ComponentProps<"img">, "alt"> &
|
||||
Required<Pick<ComponentProps<"img">, "alt">>;
|
||||
Required<Pick<ComponentProps<"img">, "alt">> & {
|
||||
optimize?: boolean;
|
||||
};
|
||||
|
||||
// biome-ignore lint/correctness/noUnusedVariables: <explanation>
|
||||
const LEGACY_IMAGE_REGEX = /\.(jpg|jpeg|png|gif|svg)$/;
|
||||
|
||||
export const Img = (props: ImgProps) => {
|
||||
// biome-ignore lint/nursery/noImgElement: <explanation>
|
||||
return <img {...props} alt={props.alt} />;
|
||||
const src = props.src;
|
||||
|
||||
if (!src) {
|
||||
// biome-ignore lint/nursery/noImgElement: <explanation>
|
||||
return <img {...props} alt={props.alt} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<picture {...props}>
|
||||
<img {...props} alt={props.alt} />
|
||||
</picture>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user