mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 21:35:19 +00:00
fix: restore from backup, restart button for tools, loader for fields
This commit is contained in:
@@ -3,6 +3,7 @@ import TransactionEditForm from "@/components/transactions/edit"
|
||||
import TransactionFiles from "@/components/transactions/transaction-files"
|
||||
import { Card } from "@/components/ui/card"
|
||||
import { getCurrentUser } from "@/lib/auth"
|
||||
import { incompleteTransactionFields } from "@/lib/stats"
|
||||
import { getCategories } from "@/models/categories"
|
||||
import { getCurrencies } from "@/models/currencies"
|
||||
import { getFields } from "@/models/fields"
|
||||
@@ -11,6 +12,7 @@ import { getProjects } from "@/models/projects"
|
||||
import { getSettings } from "@/models/settings"
|
||||
import { getTransactionById } from "@/models/transactions"
|
||||
import { notFound } from "next/navigation"
|
||||
import Link from "next/link"
|
||||
|
||||
export default async function TransactionPage({ params }: { params: Promise<{ transactionId: string }> }) {
|
||||
const { transactionId } = await params
|
||||
@@ -26,11 +28,26 @@ export default async function TransactionPage({ params }: { params: Promise<{ tr
|
||||
const settings = await getSettings(user.id)
|
||||
const fields = await getFields(user.id)
|
||||
const projects = await getProjects(user.id)
|
||||
const incompleteFields = incompleteTransactionFields(fields, transaction)
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap flex-row items-start justify-center gap-4 max-w-6xl">
|
||||
<Card className="w-full flex-1 flex flex-col flex-wrap justify-center items-start gap-10 p-5 bg-accent">
|
||||
<div className="w-full">
|
||||
<Card className="w-full flex-1 flex flex-col flex-wrap justify-center items-start overflow-hidden">
|
||||
{incompleteFields.length > 0 && (
|
||||
<div className="w-full flex flex-col gap-1 rounded-md bg-yellow-50 p-5">
|
||||
<span>
|
||||
Some fields are incomplete: <strong>{incompleteFields.map((field) => field.name).join(", ")}</strong>
|
||||
</span>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
You can decide which fields are required for you in{" "}
|
||||
<Link href="/settings/fields" className="underline">
|
||||
Fields settings
|
||||
</Link>
|
||||
.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="w-full p-5 bg-accent">
|
||||
<TransactionEditForm
|
||||
transaction={transaction}
|
||||
categories={categories}
|
||||
|
||||
Reference in New Issue
Block a user