import type { FitEnum } from "sharp" ; export interface ImageProps { src : string ; width ? : number ; height ? : number ; fit ? : keyof FitEnum ; } export function Image ( { src , width , height , fit , ... other } ) { const query = new URLSearchParams ( ) ; width && query . set ( "w" , width . toString ( ) ) ; height && query . set ( "h" , height . toString ( ) ) ; fit && query . set ( "fit" , fit ) ; return ( < img src = { `/assets/resize/${ src }?${ query . toString ( ) }` } { ... { width , height , ... other } } />); }