mirror of
https://github.com/marcogll/TaxHacker_s23.git
synced 2026-01-13 13:25:18 +00:00
chore: more linter errors
This commit is contained in:
@@ -70,7 +70,7 @@ export default async function TransactionsPage({ searchParams }: { searchParams:
|
||||
{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!
|
||||
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>
|
||||
|
||||
@@ -2,6 +2,7 @@ import SignupForm from "@/components/auth/signup-form"
|
||||
import { Card, CardContent, CardTitle } from "@/components/ui/card"
|
||||
import { ColoredText } from "@/components/ui/colored-text"
|
||||
import config from "@/lib/config"
|
||||
import Image from "next/image"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
export default async function LoginPage() {
|
||||
@@ -11,7 +12,7 @@ export default async function LoginPage() {
|
||||
|
||||
return (
|
||||
<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 ">
|
||||
<ColoredText>TaxHacker: Cloud Edition</ColoredText>
|
||||
</CardTitle>
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function subscribeToNewsletterAction(email: string) {
|
||||
})
|
||||
|
||||
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) {
|
||||
return { success: false, error: "You are already subscribed to the newsletter" }
|
||||
|
||||
@@ -34,8 +34,8 @@ export function NewsletterForm() {
|
||||
<div className="max-w-2xl mx-auto text-center">
|
||||
<h3 className="text-2xl font-semibold mb-4">Stay Tuned</h3>
|
||||
<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
|
||||
plans and new features. No marketing, ads or spam.
|
||||
We're working hard on making TaxHacker useful for everyone. Subscribe to our emails to get notified about
|
||||
our plans and new features. No marketing, ads or spam.
|
||||
</p>
|
||||
<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">
|
||||
|
||||
@@ -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 (
|
||||
<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">
|
||||
<CardTitle className="flex items-center justify-between">
|
||||
<span className="text-2xl font-bold">
|
||||
<ColoredText>Hey, I'm TaxHacker 👋</ColoredText>
|
||||
<ColoredText>Hey, I'm TaxHacker 👋</ColoredText>
|
||||
</span>
|
||||
<Button
|
||||
variant="outline"
|
||||
@@ -33,8 +34,8 @@ export async function WelcomeWidget() {
|
||||
</CardTitle>
|
||||
<CardDescription className="mt-5">
|
||||
<p className="mb-3">
|
||||
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:
|
||||
</p>
|
||||
<ul className="mb-5 list-disc pl-5 space-y-1">
|
||||
<li>
|
||||
@@ -59,7 +60,7 @@ export async function WelcomeWidget() {
|
||||
CSV export for your tax advisor.
|
||||
</li>
|
||||
<li>
|
||||
I'm still <strong>very young</strong> and can make mistakes. Use me at your own risk!
|
||||
I'm still <strong>very young</strong> and can make mistakes. Use me at your own risk!
|
||||
</li>
|
||||
</ul>
|
||||
<p className="mb-3">
|
||||
|
||||
@@ -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<EmailLayoutProps> = ({ children, preview = "" }) => (
|
||||
<html>
|
||||
<head>
|
||||
<Head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="color-scheme" content="light" />
|
||||
@@ -49,7 +50,7 @@ export const EmailLayout: React.FC<EmailLayoutProps> = ({ children, preview = ""
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</head>
|
||||
</Head>
|
||||
<body>
|
||||
<div className="container">{children}</div>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@ export const NewsletterWelcomeEmail: React.FC = () => (
|
||||
<h2 style={{ color: "#4f46e5" }}>👋 Welcome to TaxHacker!</h2>
|
||||
|
||||
<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'll keep you updated about:
|
||||
</p>
|
||||
<ul
|
||||
style={{
|
||||
|
||||
@@ -32,7 +32,7 @@ export const OTPEmail: React.FC<OTPEmailProps> = ({ otp }) => (
|
||||
</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" }}>
|
||||
If you didn't request this code, please ignore this email.
|
||||
If you didn't request this code, please ignore this email.
|
||||
</p>
|
||||
</EmailLayout>
|
||||
)
|
||||
|
||||
@@ -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,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.stopPropagation()
|
||||
|
||||
@@ -98,7 +99,9 @@ export default function ScreenDropArea({ children }: { children: React.ReactNode
|
||||
setUploadError(error instanceof Error ? error.message : "Something went wrong...")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[transactionId, router, showNotification]
|
||||
)
|
||||
|
||||
// Add event listeners to document body
|
||||
useEffect(() => {
|
||||
|
||||
@@ -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 (
|
||||
<div className="flex flex-row gap-2 items-center">
|
||||
{isLoading ? (
|
||||
|
||||
@@ -117,7 +117,7 @@ export const FormDate = ({
|
||||
if (!isNaN(newDate.getTime())) {
|
||||
setDate(newDate)
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -36,7 +36,7 @@ export function ImportCSVTable({ fields }: { fields: Field[] }) {
|
||||
setColumnMappings([])
|
||||
}
|
||||
}
|
||||
}, [parseState])
|
||||
}, [parseState, fields])
|
||||
|
||||
useEffect(() => {
|
||||
if (saveState?.success) {
|
||||
|
||||
@@ -270,7 +270,6 @@ export function CrudTable<T extends { [key: string]: any }>({ items, columns, on
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function itemDefaults<T>(columns: CrudColumn<T>[]) {
|
||||
return columns.reduce((acc, column) => {
|
||||
acc[column.key] = column.defaultValue as T[keyof T]
|
||||
|
||||
@@ -254,7 +254,7 @@ export function TransactionList({ transactions, fields = [] }: { transactions: T
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{transactions.map((transaction: any) => (
|
||||
{transactions.map((transaction) => (
|
||||
<TableRow
|
||||
key={transaction.id}
|
||||
className={cn(selectedIds.includes(transaction.id) && "bg-muted", "cursor-pointer hover:bg-muted/50")}
|
||||
|
||||
Reference in New Issue
Block a user