rust parser working on local build. fix docker build

This commit is contained in:
ZockerKatze
2025-06-24 10:23:34 +02:00
parent 7e2ada529d
commit 5ad73485ce
10 changed files with 425 additions and 24 deletions

View File

@@ -33,6 +33,7 @@ export default function Home() {
const [search, setSearch] = useState('');
const [isLoading, setIsLoading] = useState(false);
const [lastUpdate, setLastUpdate] = useState<Date | null>(null);
const [error, setError] = useState<string | null>(null);
// Get blog owner from env
const blogOwner = process.env.NEXT_PUBLIC_BLOG_OWNER || 'Anonymous';
@@ -99,12 +100,17 @@ export default function Home() {
const loadTree = async () => {
try {
setIsLoading(true);
setError(null);
const response = await fetch('/api/posts');
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const data = await response.json();
setTree(data);
setLastUpdate(new Date());
} catch (error) {
console.error('Fehler beim Laden der Beiträge:', error);
setError(error instanceof Error ? error.message : String(error));
} finally {
setIsLoading(false);
}
@@ -168,6 +174,12 @@ export default function Home() {
return (
<main className="container mx-auto px-3 sm:px-4 py-4 sm:py-8">
{/* Error display */}
{error && (
<div className="mb-4 p-4 bg-red-100 text-red-800 rounded">
<strong>Fehler:</strong> {error}
</div>
)}
{/* Mobile-first header section */}
<div className="mb-6 sm:mb-8 space-y-4 sm:space-y-0 sm:flex sm:flex-row sm:gap-4 sm:items-center sm:justify-between">
<h1 className="text-2xl sm:text-3xl md:text-4xl font-bold text-center sm:text-left">{blogOwner}&apos;s Blog</h1>