-
-
Loading exchange rates...
+
+
+
Loading exchange rates...
) : (
-
-
{formatCurrency(originalTotal * 100, originalCurrencyCode)}
-
=
-
{formatCurrency(originalTotal * 100 * exchangeRate, targetCurrencyCode).slice(0, 1)}
-
onChange?.(parseFloat(e.target.value))}
- className="w-32 rounded-md border border-input bg-transparent px-1"
- />
-
(exchange rate on {format(normalizedDate, "LLLL dd, yyyy")})
+
+
+
{formatCurrency(originalTotal * 100, originalCurrencyCode)}
+
=
+
{formatCurrency(originalTotal * 100 * exchangeRate, targetCurrencyCode).slice(0, 1)}
+
{
+ const newValue = parseFloat(e.target.value || "0")
+ !isNaN(newValue) && setConvertedTotal(Math.round(newValue * 100) / 100)
+ }}
+ className="w-32 rounded-md border border-input px-2 py-1"
+ />
+
+
The exchange rate will be added to the transaction
)}
diff --git a/components/unsorted/analyze-form.tsx b/components/unsorted/analyze-form.tsx
index 36752fd..d0e08a8 100644
--- a/components/unsorted/analyze-form.tsx
+++ b/components/unsorted/analyze-form.tsx
@@ -11,8 +11,10 @@ import { FormSelectType } from "@/components/forms/select-type"
import { FormInput, FormTextarea } from "@/components/forms/simple"
import { Button } from "@/components/ui/button"
import { Category, Currency, Field, File, Project } from "@prisma/client"
+import { format } from "date-fns"
import { Brain, Loader2 } from "lucide-react"
import { startTransition, useActionState, useMemo, useState } from "react"
+import AgentWindow from "../agents/agent-window"
export default function AnalyzeForm({
file,
@@ -197,16 +199,16 @@ export default function AnalyzeForm({
{formData.total != 0 && formData.currencyCode && formData.currencyCode !== settings.default_currency && (
- <>
+