import { Box, Container, Grid, HStack, Heading, Image, Stack, Text } from "@chakra-ui/react"; import { ArrowRight, CalendarDays } from "lucide-react"; import type { Settings } from "../../data/content"; import { Footer } from "./Footer"; import { Header } from "./Header"; import { Provider } from "./Provider"; import { WhatsAppFab } from "./WhatsAppFab"; export type BlogListItem = { slug: string; title: string; excerpt: string | null; coverImage: string | null; dateLabel: string; }; export function BlogIndex({ posts, settings }: { posts: BlogListItem[]; settings: Settings }) { const [featured, ...rest] = posts; return (
BLOG 太陽能知識庫 村屋太陽能嘅實用資訊、安裝心得同回本分析,幫你更了解點樣善用天台。 {posts.length === 0 ? ( 暫時未有文章,敬請期待。 ) : ( {/* 最新文章 featured */} {featured.coverImage && ( {featured.title} )} {featured.dateLabel} {featured.title} {featured.excerpt && ( {featured.excerpt} )} 閱讀更多 {/* 其餘文章:髮絲線清單 */} {rest.length > 0 && ( {rest.map((post) => ( {post.dateLabel} {post.title} {post.excerpt && ( {post.excerpt} )} ))} )} )}