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 { AnalyzeAllButton } from "@/components/unsorted/analyze-all-button" import AnalyzeForm from "@/components/unsorted/analyze-form" import { getCurrentUser } from "@/lib/auth" import config from "@/lib/config" 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 user = await getCurrentUser() const files = await getUnsortedFiles(user.id) const categories = await getCategories(user.id) const projects = await getProjects(user.id) const currencies = await getCurrencies(user.id) const fields = await getFields(user.id) const settings = await getSettings(user.id) return ( <>

You have {files.length} unsorted files

{files.length > 1 && }
{config.selfHosted.isEnabled && !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.
)}
{files.map((file) => (
))} {files.length == 0 && (

Everything is clear! Congrats!

Drag and drop new files here to analyze

Upload New File
)}
) }