Recipe Card Image

This commit is contained in:
Kuchenpirat 2025-07-30 09:28:21 +00:00
commit 2f950cd17b

View file

@ -28,47 +28,32 @@
</div> </div>
</template> </template>
<script lang="ts"> <script setup lang="ts">
import { useStaticRoutes, useUserApi } from "~/composables/api"; import { useStaticRoutes } from "~/composables/api";
export default defineNuxtComponent({ interface Props {
props: { tiny?: boolean | null;
tiny: { small?: boolean | null;
type: Boolean, large?: boolean | null;
default: null, iconSize?: number | string;
}, slug?: string | null;
small: { recipeId: string;
type: Boolean, imageVersion?: string | null;
default: null, height?: number | string;
}, }
large: { const props = withDefaults(defineProps<Props>(), {
type: Boolean, tiny: null,
default: null, small: null,
}, large: null,
iconSize: { iconSize: 100,
type: [Number, String], slug: null,
default: 100, imageVersion: null,
}, height: "100%",
slug: { });
type: String,
default: null, defineEmits<{
}, click: [];
recipeId: { }>();
type: String,
required: true,
},
imageVersion: {
type: String,
default: null,
},
height: {
type: [Number, String],
default: "100%",
},
},
emits: ["click"],
setup(props) {
const api = useUserApi();
const { recipeImage, recipeSmallImage, recipeTinyImage } = useStaticRoutes(); const { recipeImage, recipeSmallImage, recipeTinyImage } = useStaticRoutes();
@ -97,15 +82,6 @@ export default defineNuxtComponent({
return recipeImage(recipeId, props.imageVersion); return recipeImage(recipeId, props.imageVersion);
} }
} }
return {
api,
fallBackImage,
imageSize,
getImage,
};
},
});
</script> </script>
<style scoped> <style scoped>