fix: layout improvements

This commit is contained in:
Vasily Zubarev
2025-04-04 13:36:03 +02:00
parent 1d53434f94
commit bd6cd2c25c
4 changed files with 60 additions and 19 deletions

View File

@@ -29,6 +29,11 @@ export async function analyzeFileAction(
return { success: false, error: "File not found or does not belong to the user" }
}
const apiKey = settings.openai_api_key || config.ai.openaiApiKey || ""
if (!apiKey) {
return { success: false, error: "OpenAI API key is not set" }
}
let attachments: AnalyzeAttachment[] = []
try {
attachments = await loadAttachmentsForAI(user, file)
@@ -46,12 +51,7 @@ export async function analyzeFileAction(
const schema = fieldsToJsonSchema(fields)
const results = await analyzeTransaction(
prompt,
schema,
attachments,
settings.openai_api_key || config.ai.openaiApiKey
)
const results = await analyzeTransaction(prompt, schema, attachments, apiKey)
console.log("Analysis results:", results)

View File

@@ -14,10 +14,32 @@ export const metadata: Metadata = {
apple: "/apple-touch-icon.png",
},
manifest: "/site.webmanifest",
metadataBase: new URL(config.app.baseURL),
openGraph: {
type: "website",
locale: "en_US",
url: config.app.baseURL,
title: config.app.title,
description: config.app.description,
siteName: config.app.title,
},
twitter: {
card: "summary_large_image",
title: config.app.title,
description: config.app.description,
},
robots: {
index: true,
follow: true,
},
}
export const viewport: Viewport = {
themeColor: "#ffffff",
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: false,
}
export default async function RootLayout({ children }: { children: React.ReactNode }) {
@@ -25,8 +47,9 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<html lang="en">
<head>
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
</head>
<body>{children}</body>
<body className="min-h-screen bg-white antialiased">{children}</body>
</html>
)
}