mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 05:30:41 +01:00
- Add types/knowledge.ts with type definitions for guides, difficulty levels, and comparisons - Add lib/knowledge.ts for GitHub-based content fetching with ISR caching - Create knowledge components: DifficultyBadge, GuideCard, Callout, CodeBlock, TableOfContents - Add /knowledge/guides page with difficulty and category filters - Add /knowledge/guides/[slug] dynamic page for individual guide rendering with MDX - Add /knowledge/infrastructure page with hosting comparison overview - Update navigation menu with new Knowledge Center links Content will be fetched from g-but/botsmann-knowledge-content GitHub repo. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
766 B
TypeScript
31 lines
766 B
TypeScript
'use client';
|
|
|
|
import type { DifficultyLevel } from '@/types/knowledge';
|
|
import { difficultyConfig } from '@/types/knowledge';
|
|
|
|
interface DifficultyBadgeProps {
|
|
level: DifficultyLevel;
|
|
size?: 'sm' | 'md' | 'lg';
|
|
}
|
|
|
|
/**
|
|
* Badge component displaying difficulty level with appropriate styling
|
|
*/
|
|
export function DifficultyBadge({ level, size = 'md' }: DifficultyBadgeProps) {
|
|
const config = difficultyConfig[level];
|
|
|
|
const sizeClasses = {
|
|
sm: 'px-2 py-0.5 text-xs',
|
|
md: 'px-2.5 py-1 text-xs',
|
|
lg: 'px-3 py-1.5 text-sm',
|
|
};
|
|
|
|
return (
|
|
<span
|
|
className={`inline-flex items-center font-medium rounded-full border ${config.bgColor} ${config.color} ${config.borderColor} ${sizeClasses[size]}`}
|
|
>
|
|
{config.label}
|
|
</span>
|
|
);
|
|
}
|