diff --git a/components/dashboard/welcome-widget.tsx b/components/dashboard/welcome-widget.tsx
index 25e43f5..b351f09 100644
--- a/components/dashboard/welcome-widget.tsx
+++ b/components/dashboard/welcome-widget.tsx
@@ -5,6 +5,7 @@ import { getCurrentUser } from "@/lib/auth"
import { getSettings, updateSettings } from "@/models/settings"
import { Banknote, ChartBarStacked, FolderOpenDot, Key, TextCursorInput, X } from "lucide-react"
import { revalidatePath } from "next/cache"
+import Image from "next/image"
import Link from "next/link"
export async function WelcomeWidget() {
@@ -13,11 +14,11 @@ export async function WelcomeWidget() {
return (
-
+
- Hey, I'm TaxHacker 👋
+ Hey, I'm TaxHacker 👋
- I'm a little accountant app that tries to help you deal with endless receipts, checks and invoices with (you
- guessed it) GenAI. Here's what I can do:
+ I'm a little accountant app that tries to help you deal with endless receipts, checks and invoices with
+ (you guessed it) GenAI. Here's what I can do:
@@ -59,7 +60,7 @@ export async function WelcomeWidget() {
CSV export for your tax advisor.
- I'm still very young and can make mistakes. Use me at your own risk!
+ I'm still very young and can make mistakes. Use me at your own risk!
diff --git a/components/emails/email-layout.tsx b/components/emails/email-layout.tsx
index 7986088..dffe817 100644
--- a/components/emails/email-layout.tsx
+++ b/components/emails/email-layout.tsx
@@ -1,3 +1,4 @@
+import Head from "next/head"
import React from "react"
interface EmailLayoutProps {
@@ -7,7 +8,7 @@ interface EmailLayoutProps {
export const EmailLayout: React.FC = ({ children, preview = "" }) => (
-
+
@@ -49,7 +50,7 @@ export const EmailLayout: React.FC = ({ children, preview = ""
`,
}}
/>
-
+
{children}
diff --git a/components/emails/newsletter-welcome-email.tsx b/components/emails/newsletter-welcome-email.tsx
index 956edd4..98b2cb5 100644
--- a/components/emails/newsletter-welcome-email.tsx
+++ b/components/emails/newsletter-welcome-email.tsx
@@ -6,7 +6,7 @@ export const NewsletterWelcomeEmail: React.FC = () => (
👋 Welcome to TaxHacker!
- Thank you for subscribing to our updates. We'll keep you updated about:
+ Thank you for subscribing to our updates. We'll keep you updated about:
This code will expire in 10 minutes.
- If you didn't request this code, please ignore this email.
+ If you didn't request this code, please ignore this email.
)
diff --git a/components/files/screen-drop-area.tsx b/components/files/screen-drop-area.tsx
index 9dc49d1..972f2e7 100644
--- a/components/files/screen-drop-area.tsx
+++ b/components/files/screen-drop-area.tsx
@@ -5,7 +5,7 @@ import { uploadFilesAction } from "@/app/(app)/files/actions"
import { uploadTransactionFilesAction } from "@/app/(app)/transactions/actions"
import { AlertCircle, CloudUpload, Loader2 } from "lucide-react"
import { useParams, useRouter } from "next/navigation"
-import { startTransition, useEffect, useRef, useState } from "react"
+import { startTransition, useCallback, useEffect, useRef, useState } from "react"
export default function ScreenDropArea({ children }: { children: React.ReactNode }) {
const router = useRouter()
@@ -54,51 +54,54 @@ export default function ScreenDropArea({ children }: { children: React.ReactNode
}
}
- const handleDrop = async (e: React.DragEvent) => {
- e.preventDefault()
- e.stopPropagation()
+ const handleDrop = useCallback(
+ async (e: React.DragEvent) => {
+ e.preventDefault()
+ e.stopPropagation()
- // Reset counter and dragging state
- dragCounter.current = 0
- setIsDragging(false)
+ // Reset counter and dragging state
+ dragCounter.current = 0
+ setIsDragging(false)
- const files = e.dataTransfer.files
- if (files && files.length > 0) {
- setIsUploading(true)
- setUploadError("")
+ const files = e.dataTransfer.files
+ if (files && files.length > 0) {
+ setIsUploading(true)
+ setUploadError("")
- try {
- const formData = new FormData()
- if (transactionId) {
- formData.append("transactionId", transactionId as string)
- }
- for (let i = 0; i < files.length; i++) {
- formData.append("files", files[i])
- }
-
- startTransition(async () => {
- const result = transactionId
- ? await uploadTransactionFilesAction(formData)
- : await uploadFilesAction(formData)
-
- if (result.success) {
- showNotification({ code: "sidebar.unsorted", message: "new" })
- setTimeout(() => showNotification({ code: "sidebar.unsorted", message: "" }), 3000)
- if (!transactionId) {
- router.push("/unsorted")
- }
- } else {
- setUploadError(result.error ? result.error : "Something went wrong...")
+ try {
+ const formData = new FormData()
+ if (transactionId) {
+ formData.append("transactionId", transactionId as string)
}
+ for (let i = 0; i < files.length; i++) {
+ formData.append("files", files[i])
+ }
+
+ startTransition(async () => {
+ const result = transactionId
+ ? await uploadTransactionFilesAction(formData)
+ : await uploadFilesAction(formData)
+
+ if (result.success) {
+ showNotification({ code: "sidebar.unsorted", message: "new" })
+ setTimeout(() => showNotification({ code: "sidebar.unsorted", message: "" }), 3000)
+ if (!transactionId) {
+ router.push("/unsorted")
+ }
+ } else {
+ setUploadError(result.error ? result.error : "Something went wrong...")
+ }
+ setIsUploading(false)
+ })
+ } catch (error) {
+ console.error("Upload error:", error)
setIsUploading(false)
- })
- } catch (error) {
- console.error("Upload error:", error)
- setIsUploading(false)
- setUploadError(error instanceof Error ? error.message : "Something went wrong...")
+ setUploadError(error instanceof Error ? error.message : "Something went wrong...")
+ }
}
- }
- }
+ },
+ [transactionId, router, showNotification]
+ )
// Add event listeners to document body
useEffect(() => {
diff --git a/components/forms/convert-currency.tsx b/components/forms/convert-currency.tsx
index 2e3f4d5..4736486 100644
--- a/components/forms/convert-currency.tsx
+++ b/components/forms/convert-currency.tsx
@@ -16,10 +16,6 @@ export const FormConvertCurrency = ({
date?: Date | undefined
onChange?: (value: number) => void
}) => {
- if (!originalTotal || !originalCurrencyCode || !targetCurrencyCode || originalCurrencyCode === targetCurrencyCode) {
- return <>>
- }
-
const normalizedDate = startOfDay(date || new Date(Date.now() - 24 * 60 * 60 * 1000))
const normalizedDateString = format(normalizedDate, "yyyy-MM-dd")
const [exchangeRate, setExchangeRate] = useState(0)
@@ -54,6 +50,10 @@ export const FormConvertCurrency = ({
onChange?.(convertedTotal)
}, [convertedTotal])
+ if (!originalTotal || !originalCurrencyCode || !targetCurrencyCode || originalCurrencyCode === targetCurrencyCode) {
+ return <>>
+ }
+
return (
{isLoading ? (
diff --git a/components/forms/simple.tsx b/components/forms/simple.tsx
index 6386985..0a9d7e3 100644
--- a/components/forms/simple.tsx
+++ b/components/forms/simple.tsx
@@ -117,7 +117,7 @@ export const FormDate = ({
if (!isNaN(newDate.getTime())) {
setDate(newDate)
}
- } catch (_) {}
+ } catch {}
}
return (
diff --git a/components/import/csv.tsx b/components/import/csv.tsx
index 586e50d..907d381 100644
--- a/components/import/csv.tsx
+++ b/components/import/csv.tsx
@@ -36,7 +36,7 @@ export function ImportCSVTable({ fields }: { fields: Field[] }) {
setColumnMappings([])
}
}
- }, [parseState])
+ }, [parseState, fields])
useEffect(() => {
if (saveState?.success) {
diff --git a/components/settings/crud.tsx b/components/settings/crud.tsx
index 0d9cd94..f85011d 100644
--- a/components/settings/crud.tsx
+++ b/components/settings/crud.tsx
@@ -270,7 +270,6 @@ export function CrudTable({ items, columns, on
)
}
-
function itemDefaults(columns: CrudColumn[]) {
return columns.reduce((acc, column) => {
acc[column.key] = column.defaultValue as T[keyof T]
diff --git a/components/transactions/list.tsx b/components/transactions/list.tsx
index e41993c..a89fdd4 100644
--- a/components/transactions/list.tsx
+++ b/components/transactions/list.tsx
@@ -254,7 +254,7 @@ export function TransactionList({ transactions, fields = [] }: { transactions: T
- {transactions.map((transaction: any) => (
+ {transactions.map((transaction) => (