refactor: add sample data download link for non-production environments

This commit is contained in:
2025-11-12 19:47:49 +01:00
parent 15c0ee995e
commit c648009317
2 changed files with 10 additions and 1 deletions
View File
+10 -1
View File
@@ -2,6 +2,7 @@ import { Download } from "lucide-react"
import Link from "next/link" import Link from "next/link"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import { ENVIRONMENT } from "@/lib/constants"
import { CategoryService } from "@/services/category.service" import { CategoryService } from "@/services/category.service"
import ImportForm from "./_components/import.form" import ImportForm from "./_components/import.form"
@@ -14,10 +15,18 @@ export default async function ImportPage() {
<h1 className="text-2xl font-bold">Mass Import</h1> <h1 className="text-2xl font-bold">Mass Import</h1>
</div> </div>
<div className="flex items-center justify-end gap-4"> <div className="flex items-center justify-end gap-4">
{ENVIRONMENT !== "production" && (
<Link href="/sample_data.csv" download>
<Button variant="outline">
<Download />
Sample Data
</Button>
</Link>
)}
<Link href="/template.csv" download> <Link href="/template.csv" download>
<Button variant="outline"> <Button variant="outline">
<Download /> <Download />
Download Template Template
</Button> </Button>
</Link> </Link>
</div> </div>