mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
feat: filters, settings, backups fix: ts compile errors feat: new dashboard, webp previews and settings feat: use webp for pdfs feat: use webp fix: analyze resets old data fix: switch to corsproxy fix: switch to free cors fix: max upload limit fix: currency conversion feat: transaction export fix: currency conversion feat: refactor settings actions feat: new loader feat: README + LICENSE doc: update readme doc: update readme doc: update readme doc: update screenshots ci: bump prisma
72 lines
2.7 KiB
TypeScript
72 lines
2.7 KiB
TypeScript
import { ExportTransactionsDialog } from "@/components/export/transactions"
|
|
import { UploadButton } from "@/components/files/upload-button"
|
|
import { TransactionSearchAndFilters } from "@/components/transactions/filters"
|
|
import { TransactionList } from "@/components/transactions/list"
|
|
import { NewTransactionDialog } from "@/components/transactions/new"
|
|
import { Button } from "@/components/ui/button"
|
|
import { getCategories } from "@/data/categories"
|
|
import { getFields } from "@/data/fields"
|
|
import { getProjects } from "@/data/projects"
|
|
import { getTransactions, TransactionFilters } from "@/data/transactions"
|
|
import { Download, Plus, Upload } from "lucide-react"
|
|
import { Metadata } from "next"
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Transactions",
|
|
description: "Manage your transactions",
|
|
}
|
|
|
|
export default async function TransactionsPage({ searchParams }: { searchParams: Promise<TransactionFilters> }) {
|
|
const filters = await searchParams
|
|
const transactions = await getTransactions(filters)
|
|
const categories = await getCategories()
|
|
const projects = await getProjects()
|
|
const fields = await getFields()
|
|
|
|
return (
|
|
<>
|
|
<header className="flex flex-wrap items-center justify-between gap-2 mb-8">
|
|
<h2 className="text-3xl font-bold tracking-tight">Transactions</h2>
|
|
<div className="flex gap-2">
|
|
<ExportTransactionsDialog filters={filters} fields={fields} categories={categories} projects={projects}>
|
|
<Button variant="outline">
|
|
<Download />
|
|
<span className="hidden md:block">Export</span>
|
|
</Button>
|
|
</ExportTransactionsDialog>
|
|
<NewTransactionDialog>
|
|
<Button>
|
|
<Plus /> <span className="hidden md:block">Add Transaction</span>
|
|
</Button>
|
|
</NewTransactionDialog>
|
|
</div>
|
|
</header>
|
|
|
|
<TransactionSearchAndFilters categories={categories} projects={projects} />
|
|
|
|
<main>
|
|
<TransactionList transactions={transactions} />
|
|
|
|
{transactions.length === 0 && (
|
|
<div className="flex flex-col items-center justify-center gap-2 h-full min-h-[400px]">
|
|
<p className="text-muted-foreground">
|
|
You don't seem to have any transactions yet. Let's start and create the first one!
|
|
</p>
|
|
<div className="flex flex-row gap-5 mt-8">
|
|
<UploadButton>
|
|
<Upload /> Analyze New Invoice
|
|
</UploadButton>
|
|
<NewTransactionDialog>
|
|
<Button variant="outline">
|
|
<Plus />
|
|
Add Manually
|
|
</Button>
|
|
</NewTransactionDialog>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</main>
|
|
</>
|
|
)
|
|
}
|