feat: add feature UI components with useQuery hooks
- navigation: SiteHeader component + useHeader hook - blog: ArticleCard, ArticleList, ArticleDetail + useArticleList, useArticleBySlug hooks - marketing-pages: PageHero, PageContent + usePageBySlug, useSiteSettings hooks - App pages now thin server wrappers that prefetch + hydrate; feature components own their data fetching via useSuspenseQuery
This commit is contained in:
23
packages/blog/src/ui/components/article-card.tsx
Normal file
23
packages/blog/src/ui/components/article-card.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { Article } from "../../entities/models/article";
|
||||
|
||||
export type ArticleCardProps = {
|
||||
article: Article;
|
||||
};
|
||||
|
||||
export function ArticleCard({ article }: ArticleCardProps) {
|
||||
return (
|
||||
<article className="rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/50">
|
||||
<a href={`/blog/${article.slug}`}>
|
||||
<h3 className="text-lg font-semibold text-card-foreground">
|
||||
{article.title}
|
||||
</h3>
|
||||
</a>
|
||||
<time
|
||||
className="text-sm text-muted-foreground"
|
||||
dateTime={article.createdAt.toISOString()}
|
||||
>
|
||||
{article.createdAt.toLocaleDateString()}
|
||||
</time>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user