refactor: enhance UI components and navigation structure, implement export functionality for wizard steps, and update routing for improved user experience

This commit is contained in:
Jennie Robinson Faber 2025-08-16 13:17:36 +01:00
parent 37ab8d7bab
commit d7e52293e4
18 changed files with 3802 additions and 3318 deletions

View file

@ -1,9 +1,21 @@
<template>
<div class="space-y-6">
<div>
<h3 class="text-2xl font-black text-black mb-4">
Where does your money go?
</h3>
<div class="max-w-4xl mx-auto space-y-6">
<!-- Section Header with Export Controls -->
<div class="flex items-center justify-between mb-8">
<div>
<h3 class="text-2xl font-black text-black mb-2">
Where does your money go?
</h3>
<p class="text-neutral-600">
Add costs like rent, tools, insurance, or other recurring expenses.
</p>
</div>
<div class="flex items-center gap-3">
<UButton variant="outline" color="gray" size="sm" @click="exportCosts">
<UIcon name="i-heroicons-arrow-down-tray" class="mr-1" />
Export
</UButton>
</div>
</div>
<!-- Overhead Costs -->
@ -31,7 +43,7 @@
class="text-center py-12 border-4 border-dashed border-black rounded-xl bg-white shadow-lg">
<h4 class="font-medium text-neutral-900 mb-2">No overhead costs yet</h4>
<p class="text-sm text-neutral-500 mb-4">
Add costs like rent, tools, insurance, or other recurring expenses.
Get started by adding your first overhead cost.
</p>
<UButton
@click="addOverheadCost"
@ -202,4 +214,24 @@ function addOverheadCost() {
function removeCost(id: string) {
budgetStore.removeOverheadLine(id);
}
function exportCosts() {
const exportData = {
overheadCosts: overheadCosts.value,
exportedAt: new Date().toISOString(),
section: "costs",
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
type: "application/json",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `coop-costs-${new Date().toISOString().split("T")[0]}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
</script>