import { motion } from 'framer-motion'; import Link from 'next/link'; import Image from 'next/image'; import { supabase } from '../lib/supabase'; // Funktion zur Validierung von Bildpfaden const isValidImagePath = (imagePath) => { if (!imagePath || typeof imagePath !== 'string') return false; return imagePath.startsWith('/') || imagePath.startsWith('http://') || imagePath.startsWith('https://'); }; export default function DevLog({ devlogData }) { return (

Entwicklungs-Log

Verfolgen Sie die neuesten Updates und Fortschritte unserer Projekte.

{devlogData && devlogData.map((log, index) => ( {log.image && isValidImagePath(log.image) && (
{log.title}
)}

{log.title}

{log.date}

{log.description}

Mehr erfahren
))}
); } export async function getServerSideProps() { try { const { data: devlogData, error } = await supabase .from('devlog_entries') .select('*') .order('created_at', { ascending: false }); if (error) { console.error('Error fetching devlog data:', error); return { props: { devlogData: [] } }; } return { props: { devlogData: devlogData || [] } }; } catch (error) { console.error('Error in getServerSideProps:', error); return { props: { devlogData: [] } }; } }