Files
accounted/components/extensions/ExtensionCard.tsx
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

45 lines
1.7 KiB
TypeScript

import { getTranslations } from 'next-intl/server'
import { Card, CardContent } from '@/components/ui/card'
import { resolveIcon } from '@/lib/extensions/icon-resolver'
import { extensionNameKey, extensionDescriptionKey } from '@/lib/extensions/i18n'
import type { ExtensionDefinition } from '@/lib/extensions/types'
import CategoryBadge from './CategoryBadge'
import Link from 'next/link'
export default async function ExtensionCard({ extension }: { extension: ExtensionDefinition }) {
const t = await getTranslations('extensions')
const nameKey = extensionNameKey(extension.slug)
const descriptionKey = extensionDescriptionKey(extension.slug)
const name = nameKey ? t(nameKey) : extension.name
const description = descriptionKey ? t(descriptionKey) : extension.description
const Icon = resolveIcon(extension.icon)
return (
<Card className="group relative">
<CardContent className="p-6">
<div className="flex items-start gap-3 min-w-0">
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-secondary flex-shrink-0">
<Icon className="h-5 w-5 text-foreground" />
</div>
<div className="min-w-0">
<Link
href={`/extensions/${extension.sector}/${extension.slug}`}
className="text-sm font-medium hover:underline"
>
{name}
</Link>
<p className="text-xs text-muted-foreground mt-0.5 line-clamp-2">
{description}
</p>
<div className="mt-2">
<CategoryBadge category={extension.category} />
</div>
</div>
</div>
</CardContent>
</Card>
)
}