@pharmonie You should be passing the data components need as props. That’s the purpose of them. It then makes your components more reusable.
So, if you pass purchase data to your MostRecentPurchases component via a prop, then your component doesn’t care where the data is coming from, just that it does get that data, so you can re-use that component where ever you need: on the user’s page, in an admin panel, inside an Inertia page, in a non-Inertia page, etc. It doesn’t care and just renders what it’s given.
<script lang="ts" setup>
type Purchase = {
id: string;
// Declare other purchase fields and their types here...
};
defineProps<{
purchases: Purchase[],
}>();
</script>
<template>
<ul>
<li v-bind:key="purchase.id" v-for="purchase in purchases">
<!-- Render purchase information here -->
</li>
</ul>
</template>