Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / apps/web/components/resource-card.tsx |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | apps/web/components/resource-card.tsx |
| Original SHA-256 | 486bb82418b7079443dff5002dd45b824ebe2c434b0d19f2d8728d71a4b533f0 |
| Git blob SHA | 2465919d4fb23f9130fadf5cd3a1bb90b1d348f2 |
| Reading-copy SHA-256 | 486bb82418b7079443dff5002dd45b824ebe2c434b0d19f2d8728d71a4b533f0 |
Recovered source transcript
Download complete source text ↓52 lines · 1.6 KB
import { Badge } from '@thedaviddias/design-system/badge'
import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { Card } from '@/components/ui/card'
import { formatDate } from '@/lib/utils'
interface ResourceCardProps {
resource: {
slug: string
title: string
description: string
url: string
date: string
type: string
source: string
tags?: string[]
}
}
/**
* Renders a card displaying a resource with title, description, and metadata
*/
export function ResourceCard({ resource }: ResourceCardProps) {
return (
<Card className="p-6 transition-all hover:border-primary hover:bg-muted/50">
<article className="space-y-4">
<div className="flex items-center justify-between">
<Badge variant="secondary">{resource.type}</Badge>
<time className="text-sm text-muted-foreground" dateTime={resource.date}>
{formatDate(resource.date)}
</time>
</div>
<h3 className="text-xl font-bold">
<Link href={resource.url} className="hover:underline" target="_blank">
{resource.title}
<ExternalLink className="inline-block ml-2 size-4" />
</Link>
</h3>
<p className="text-muted-foreground">{resource.description}</p>
<div className="flex items-center gap-2">
<Badge variant="outline">{resource.source}</Badge>
{resource.tags?.map(tag => (
<Badge key={tag} variant="secondary">
{tag}
</Badge>
))}
</div>
</article>
</Card>
)
}