Integracja Directus LabAI, naprawa Schema.org, poprawki UI
- Zmiana kolekcji Directus z Laboratorium_AI na LabAI - Usunięcie fallbacku na fake dane — brak wpisów = komunikat - revalidate=0 na stronie głównej (zawsze świeże dane) - BlogPosting przeniesiony do @graph (poprawna spec Schema.org) - Inbox Libredesk zaktualizowany - Hero image-wrap powiększony (scale 1.56) - Dokumentacja projektu w CLAUDE.md Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
import Hero from '../sections/Hero'
|
||||
import Benefits from '../sections/Benefits'
|
||||
import ProductsPreview from '../sections/ProductsPreview'
|
||||
import BentoCard from '../components/BentoCard'
|
||||
import BentoSlideshow from '../components/BentoSlideshow'
|
||||
import SubscribeBox from '../components/SubscribeBox'
|
||||
import { fetchLaboratoriumData, mapDirectusToContent } from '../lib/directus'
|
||||
import { newsData, videosData } from '../data/content'
|
||||
|
||||
export const revalidate = 0
|
||||
|
||||
async function getContent() {
|
||||
try {
|
||||
const items = await fetchLaboratoriumData()
|
||||
return mapDirectusToContent(items)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export default async function HomePage() {
|
||||
const content = await getContent()
|
||||
|
||||
return (
|
||||
<>
|
||||
<Hero />
|
||||
<Benefits />
|
||||
<ProductsPreview />
|
||||
<div className="page-wrapper">
|
||||
<main className="bento-area" aria-label="Artykuły">
|
||||
{!content ? (
|
||||
<p style={{ gridColumn: '1 / 5', padding: '4rem', textAlign: 'center', color: '#888' }}>
|
||||
W tej chwili brak wpisów.
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<BentoSlideshow
|
||||
slides={content.slideshow}
|
||||
style={{ gridColumn: '1 / 5', gridRow: '1 / 2' }}
|
||||
/>
|
||||
{content.articles.map((article, index) => (
|
||||
<BentoCard
|
||||
key={index}
|
||||
type={article.type}
|
||||
badge={article.badge}
|
||||
title={article.title}
|
||||
category={article.category}
|
||||
readTime={article.readTime}
|
||||
bgImage={article.bgImage}
|
||||
hero={article.hero}
|
||||
style={{ gridColumn: article.gridColumn, gridRow: article.gridRow }}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</main>
|
||||
|
||||
<aside className="sidebar sidebar-right" aria-label="Najnowsze wideo">
|
||||
<div>
|
||||
<h3 className="sidebar-title">LATEST VIDEOS</h3>
|
||||
{videosData.map((video, index) => (
|
||||
<div key={index} className="video-item" tabIndex={0}>
|
||||
<div
|
||||
className="video-thumb"
|
||||
style={{ backgroundImage: `url(${video.bgImage})` }}
|
||||
role="img"
|
||||
aria-label={video.title}
|
||||
/>
|
||||
<div className="video-info">
|
||||
<div className="video-title">{video.title}</div>
|
||||
<div className="video-views">{video.views}</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<SubscribeBox />
|
||||
|
||||
<div style={{ marginTop: '2rem' }}>
|
||||
<h3 className="sidebar-title">LATEST AI NEWS</h3>
|
||||
<div className="news-list">
|
||||
{newsData.map((item, index) => (
|
||||
<div key={index} className="news-item" tabIndex={0}>
|
||||
<div className="news-time">{item.time}</div>
|
||||
<div className="news-title">{item.title}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user