import { FilePreview } from "@/components/files/preview" import { UploadButton } from "@/components/files/upload-button" import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" import { Button } from "@/components/ui/button" import { Card } from "@/components/ui/card" import AnalyzeForm from "@/components/unsorted/analyze-form" import { getCategories } from "@/models/categories" import { getCurrencies } from "@/models/currencies" import { getFields } from "@/models/fields" import { getUnsortedFiles } from "@/models/files" import { getProjects } from "@/models/projects" import { getSettings } from "@/models/settings" import { FileText, PartyPopper, Settings, Upload } from "lucide-react" import { Metadata } from "next" import Link from "next/link" export const metadata: Metadata = { title: "Unsorted", description: "Analyze unsorted files", } export default async function UnsortedPage() { const files = await getUnsortedFiles() const categories = await getCategories() const projects = await getProjects() const currencies = await getCurrencies() const fields = await getFields() const settings = await getSettings() return ( <> You have {files.length} unsorted files {!settings.openai_api_key && ( ChatGPT API Key is required for analyzing files Please set your OpenAI API key in the settings to use the analyze form. Go to Settings )} {files.map((file) => ( ))} {files.length == 0 && ( Everything is clear! Congrats! Drag and drop new files here to analyze Upload New File Go to Transactions )} > ) }
Everything is clear! Congrats!
Drag and drop new files here to analyze