feat: cache ai results on server + show success banner

This commit is contained in:
vas3k
2025-05-20 22:32:38 +02:00
parent c352f5eadd
commit f5c5bf75f6
11 changed files with 142 additions and 84 deletions

View File

@@ -67,7 +67,7 @@ export async function analyzeFileAction(
const schema = fieldsToJsonSchema(fields)
const results = await analyzeTransaction(prompt, schema, attachments, apiKey)
const results = await analyzeTransaction(prompt, schema, attachments, apiKey, file.id, user.id)
console.log("Analysis results:", results)

View File

@@ -3,7 +3,7 @@ import { Loader2 } from "lucide-react"
export default function Loading() {
return (
<div className="flex flex-col gap-4 p-4 w-full max-w-6xl">
<div className="flex flex-col gap-6 p-4 w-full max-w-6xl">
<header className="flex items-center justify-between">
<h2 className="text-3xl font-bold tracking-tight flex flex-row gap-2">
<span>Loading unsorted files...</span>

View File

@@ -31,7 +31,7 @@ export default async function UnsortedPage() {
const settings = await getSettings(user.id)
return (
<div className="flex flex-col gap-4 p-4 w-full max-w-6xl">
<div className="flex flex-col gap-6 p-4 w-full max-w-6xl">
<header className="flex items-center justify-between">
<h2 className="text-3xl font-bold tracking-tight">You have {files.length} unsorted files</h2>
</header>