chore: more linter errors

This commit is contained in:
Vasily Zubarev
2025-04-10 11:58:28 +02:00
parent 29a4ac4977
commit d88d0a1174
14 changed files with 67 additions and 62 deletions

View File

@@ -70,7 +70,7 @@ export default async function TransactionsPage({ searchParams }: { searchParams:
{transactions.length === 0 && ( {transactions.length === 0 && (
<div className="flex flex-col items-center justify-center gap-2 h-full min-h-[400px]"> <div className="flex flex-col items-center justify-center gap-2 h-full min-h-[400px]">
<p className="text-muted-foreground"> <p className="text-muted-foreground">
You don't seem to have any transactions yet. Let's start and create the first one! You don&apos;t seem to have any transactions yet. Let&apos;s start and create the first one!
</p> </p>
<div className="flex flex-row gap-5 mt-8"> <div className="flex flex-row gap-5 mt-8">
<UploadButton> <UploadButton>

View File

@@ -2,6 +2,7 @@ import SignupForm from "@/components/auth/signup-form"
import { Card, CardContent, CardTitle } from "@/components/ui/card" import { Card, CardContent, CardTitle } from "@/components/ui/card"
import { ColoredText } from "@/components/ui/colored-text" import { ColoredText } from "@/components/ui/colored-text"
import config from "@/lib/config" import config from "@/lib/config"
import Image from "next/image"
import { redirect } from "next/navigation" import { redirect } from "next/navigation"
export default async function LoginPage() { export default async function LoginPage() {
@@ -11,7 +12,7 @@ export default async function LoginPage() {
return ( return (
<Card className="w-full max-w-xl mx-auto p-8 flex flex-col items-center justify-center gap-4"> <Card className="w-full max-w-xl mx-auto p-8 flex flex-col items-center justify-center gap-4">
<img src="/logo/512.png" alt="Logo" className="w-36 h-36" /> <Image src="/logo/512.png" alt="Logo" width={144} height={144} className="w-36 h-36" />
<CardTitle className="text-3xl font-bold "> <CardTitle className="text-3xl font-bold ">
<ColoredText>TaxHacker: Cloud Edition</ColoredText> <ColoredText>TaxHacker: Cloud Edition</ColoredText>
</CardTitle> </CardTitle>

View File

@@ -14,7 +14,7 @@ export async function subscribeToNewsletterAction(email: string) {
}) })
if (existingContacts.data) { if (existingContacts.data) {
const existingContact = existingContacts.data.data.find((contact: any) => contact.email === email) const existingContact = existingContacts.data.data.find((contact: { email: string }) => contact.email === email)
if (existingContact) { if (existingContact) {
return { success: false, error: "You are already subscribed to the newsletter" } return { success: false, error: "You are already subscribed to the newsletter" }

View File

@@ -34,8 +34,8 @@ export function NewsletterForm() {
<div className="max-w-2xl mx-auto text-center"> <div className="max-w-2xl mx-auto text-center">
<h3 className="text-2xl font-semibold mb-4">Stay Tuned</h3> <h3 className="text-2xl font-semibold mb-4">Stay Tuned</h3>
<p className="text-gray-600 mb-6"> <p className="text-gray-600 mb-6">
We're working hard on making TaxHacker useful for everyone. Subscribe to our emails to get notified about our We&apos;re working hard on making TaxHacker useful for everyone. Subscribe to our emails to get notified about
plans and new features. No marketing, ads or spam. our plans and new features. No marketing, ads or spam.
</p> </p>
<form onSubmit={handleSubmit} className="flex flex-col gap-4 max-w-md mx-auto"> <form onSubmit={handleSubmit} className="flex flex-col gap-4 max-w-md mx-auto">
<div className="flex flex-wrap items-center justify-center gap-4"> <div className="flex flex-wrap items-center justify-center gap-4">

View File

@@ -5,6 +5,7 @@ import { getCurrentUser } from "@/lib/auth"
import { getSettings, updateSettings } from "@/models/settings" import { getSettings, updateSettings } from "@/models/settings"
import { Banknote, ChartBarStacked, FolderOpenDot, Key, TextCursorInput, X } from "lucide-react" import { Banknote, ChartBarStacked, FolderOpenDot, Key, TextCursorInput, X } from "lucide-react"
import { revalidatePath } from "next/cache" import { revalidatePath } from "next/cache"
import Image from "next/image"
import Link from "next/link" import Link from "next/link"
export async function WelcomeWidget() { export async function WelcomeWidget() {
@@ -13,11 +14,11 @@ export async function WelcomeWidget() {
return ( return (
<Card className="flex flex-col lg:flex-row items-start gap-10 p-10 w-full"> <Card className="flex flex-col lg:flex-row items-start gap-10 p-10 w-full">
<img src="/logo/1024.png" alt="Logo" className="w-64 h-64" /> <Image src="/logo/1024.png" alt="Logo" width={256} height={256} className="w-64 h-64" />
<div className="flex flex-col"> <div className="flex flex-col">
<CardTitle className="flex items-center justify-between"> <CardTitle className="flex items-center justify-between">
<span className="text-2xl font-bold"> <span className="text-2xl font-bold">
<ColoredText>Hey, I'm TaxHacker 👋</ColoredText> <ColoredText>Hey, I&apos;m TaxHacker 👋</ColoredText>
</span> </span>
<Button <Button
variant="outline" variant="outline"
@@ -33,8 +34,8 @@ export async function WelcomeWidget() {
</CardTitle> </CardTitle>
<CardDescription className="mt-5"> <CardDescription className="mt-5">
<p className="mb-3"> <p className="mb-3">
I'm a little accountant app that tries to help you deal with endless receipts, checks and invoices with (you I&apos;m a little accountant app that tries to help you deal with endless receipts, checks and invoices with
guessed it) GenAI. Here's what I can do: (you guessed it) GenAI. Here&apos;s what I can do:
</p> </p>
<ul className="mb-5 list-disc pl-5 space-y-1"> <ul className="mb-5 list-disc pl-5 space-y-1">
<li> <li>
@@ -59,7 +60,7 @@ export async function WelcomeWidget() {
CSV export for your tax advisor. CSV export for your tax advisor.
</li> </li>
<li> <li>
I'm still <strong>very young</strong> and can make mistakes. Use me at your own risk! I&apos;m still <strong>very young</strong> and can make mistakes. Use me at your own risk!
</li> </li>
</ul> </ul>
<p className="mb-3"> <p className="mb-3">

View File

@@ -1,3 +1,4 @@
import Head from "next/head"
import React from "react" import React from "react"
interface EmailLayoutProps { interface EmailLayoutProps {
@@ -7,7 +8,7 @@ interface EmailLayoutProps {
export const EmailLayout: React.FC<EmailLayoutProps> = ({ children, preview = "" }) => ( export const EmailLayout: React.FC<EmailLayoutProps> = ({ children, preview = "" }) => (
<html> <html>
<head> <Head>
<meta charSet="utf-8" /> <meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light" /> <meta name="color-scheme" content="light" />
@@ -49,7 +50,7 @@ export const EmailLayout: React.FC<EmailLayoutProps> = ({ children, preview = ""
`, `,
}} }}
/> />
</head> </Head>
<body> <body>
<div className="container">{children}</div> <div className="container">{children}</div>
</body> </body>

View File

@@ -6,7 +6,7 @@ export const NewsletterWelcomeEmail: React.FC = () => (
<h2 style={{ color: "#4f46e5" }}>👋 Welcome to TaxHacker!</h2> <h2 style={{ color: "#4f46e5" }}>👋 Welcome to TaxHacker!</h2>
<p style={{ fontSize: "16px", lineHeight: "1.5", color: "#333" }}> <p style={{ fontSize: "16px", lineHeight: "1.5", color: "#333" }}>
Thank you for subscribing to our updates. We'll keep you updated about: Thank you for subscribing to our updates. We&apos;ll keep you updated about:
</p> </p>
<ul <ul
style={{ style={{

View File

@@ -32,7 +32,7 @@ export const OTPEmail: React.FC<OTPEmailProps> = ({ otp }) => (
</div> </div>
<p style={{ fontSize: "14px", color: "#666", textAlign: "center" }}>This code will expire in 10 minutes.</p> <p style={{ fontSize: "14px", color: "#666", textAlign: "center" }}>This code will expire in 10 minutes.</p>
<p style={{ fontSize: "14px", color: "#666", textAlign: "center" }}> <p style={{ fontSize: "14px", color: "#666", textAlign: "center" }}>
If you didn't request this code, please ignore this email. If you didn&apos;t request this code, please ignore this email.
</p> </p>
</EmailLayout> </EmailLayout>
) )

View File

@@ -5,7 +5,7 @@ import { uploadFilesAction } from "@/app/(app)/files/actions"
import { uploadTransactionFilesAction } from "@/app/(app)/transactions/actions" import { uploadTransactionFilesAction } from "@/app/(app)/transactions/actions"
import { AlertCircle, CloudUpload, Loader2 } from "lucide-react" import { AlertCircle, CloudUpload, Loader2 } from "lucide-react"
import { useParams, useRouter } from "next/navigation" 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 }) { export default function ScreenDropArea({ children }: { children: React.ReactNode }) {
const router = useRouter() const router = useRouter()
@@ -54,7 +54,8 @@ export default function ScreenDropArea({ children }: { children: React.ReactNode
} }
} }
const handleDrop = async (e: React.DragEvent<HTMLDivElement>) => { const handleDrop = useCallback(
async (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
@@ -98,7 +99,9 @@ export default function ScreenDropArea({ children }: { children: React.ReactNode
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 // Add event listeners to document body
useEffect(() => { useEffect(() => {

View File

@@ -16,10 +16,6 @@ export const FormConvertCurrency = ({
date?: Date | undefined date?: Date | undefined
onChange?: (value: number) => void onChange?: (value: number) => void
}) => { }) => {
if (!originalTotal || !originalCurrencyCode || !targetCurrencyCode || originalCurrencyCode === targetCurrencyCode) {
return <></>
}
const normalizedDate = startOfDay(date || new Date(Date.now() - 24 * 60 * 60 * 1000)) const normalizedDate = startOfDay(date || new Date(Date.now() - 24 * 60 * 60 * 1000))
const normalizedDateString = format(normalizedDate, "yyyy-MM-dd") const normalizedDateString = format(normalizedDate, "yyyy-MM-dd")
const [exchangeRate, setExchangeRate] = useState(0) const [exchangeRate, setExchangeRate] = useState(0)
@@ -54,6 +50,10 @@ export const FormConvertCurrency = ({
onChange?.(convertedTotal) onChange?.(convertedTotal)
}, [convertedTotal]) }, [convertedTotal])
if (!originalTotal || !originalCurrencyCode || !targetCurrencyCode || originalCurrencyCode === targetCurrencyCode) {
return <></>
}
return ( return (
<div className="flex flex-row gap-2 items-center"> <div className="flex flex-row gap-2 items-center">
{isLoading ? ( {isLoading ? (

View File

@@ -117,7 +117,7 @@ export const FormDate = ({
if (!isNaN(newDate.getTime())) { if (!isNaN(newDate.getTime())) {
setDate(newDate) setDate(newDate)
} }
} catch (_) {} } catch {}
} }
return ( return (

View File

@@ -36,7 +36,7 @@ export function ImportCSVTable({ fields }: { fields: Field[] }) {
setColumnMappings([]) setColumnMappings([])
} }
} }
}, [parseState]) }, [parseState, fields])
useEffect(() => { useEffect(() => {
if (saveState?.success) { if (saveState?.success) {

View File

@@ -270,7 +270,6 @@ export function CrudTable<T extends { [key: string]: any }>({ items, columns, on
</div> </div>
) )
} }
function itemDefaults<T>(columns: CrudColumn<T>[]) { function itemDefaults<T>(columns: CrudColumn<T>[]) {
return columns.reduce((acc, column) => { return columns.reduce((acc, column) => {
acc[column.key] = column.defaultValue as T[keyof T] acc[column.key] = column.defaultValue as T[keyof T]

View File

@@ -254,7 +254,7 @@ export function TransactionList({ transactions, fields = [] }: { transactions: T
</TableRow> </TableRow>
</TableHeader> </TableHeader>
<TableBody> <TableBody>
{transactions.map((transaction: any) => ( {transactions.map((transaction) => (
<TableRow <TableRow
key={transaction.id} key={transaction.id}
className={cn(selectedIds.includes(transaction.id) && "bg-muted", "cursor-pointer hover:bg-muted/50")} className={cn(selectedIds.includes(transaction.id) && "bg-muted", "cursor-pointer hover:bg-muted/50")}