|
1 | | -import { Calendar, ChevronRight, ExternalLink } from "lucide-react"; |
| 1 | +import { |
| 2 | + AlertCircle, |
| 3 | + Calendar, |
| 4 | + ChevronRight, |
| 5 | + ExternalLink, |
| 6 | +} from "lucide-react"; |
2 | 7 | import Link from "next/link"; |
3 | 8 | import { notFound } from "next/navigation"; |
4 | 9 | import { MDXContent } from "@/components/mdx-content"; |
@@ -52,81 +57,113 @@ export default async function KitPage(props: KitPageProps) { |
52 | 57 |
|
53 | 58 | return ( |
54 | 59 | <div className="container px-4 sm:px-6 py-6 sm:py-8 md:py-12"> |
55 | | - <article className="mx-auto max-w-3xl"> |
| 60 | + <article className="mx-auto max-w-3xl min-w-0"> |
56 | 61 | {/* Breadcrumbs */} |
57 | | - <nav className="flex items-center gap-2 text-sm text-muted-foreground mb-6"> |
58 | | - <Link href="/" className="hover:text-foreground transition-colors"> |
| 62 | + <nav className="flex items-center gap-2 text-sm text-muted-foreground mb-6 overflow-x-auto"> |
| 63 | + <Link |
| 64 | + href="/" |
| 65 | + className="hover:text-foreground transition-colors whitespace-nowrap" |
| 66 | + > |
59 | 67 | Home |
60 | 68 | </Link> |
61 | | - <ChevronRight className="h-4 w-4" /> |
| 69 | + <ChevronRight className="h-4 w-4 shrink-0" /> |
62 | 70 | <Link |
63 | 71 | href="/kits" |
64 | | - className="hover:text-foreground transition-colors" |
| 72 | + className="hover:text-foreground transition-colors whitespace-nowrap" |
65 | 73 | > |
66 | 74 | Kits |
67 | 75 | </Link> |
68 | | - <ChevronRight className="h-4 w-4" /> |
69 | | - <span className="text-foreground">{kit.title}</span> |
| 76 | + <ChevronRight className="h-4 w-4 shrink-0" /> |
| 77 | + <span className="text-foreground truncate">{kit.title}</span> |
70 | 78 | </nav> |
71 | 79 |
|
72 | 80 | <div className="space-y-4 sm:space-y-6"> |
73 | 81 | {/* Header */} |
74 | 82 | <div className="space-y-3 sm:space-y-4"> |
75 | | - <div className="flex items-center gap-2 flex-wrap"> |
76 | | - <Badge variant={statusVariant[kit.status]} className="text-xs"> |
| 83 | + <h1 className="text-2xl font-bold tracking-tight sm:text-3xl md:text-4xl lg:text-5xl"> |
| 84 | + {kit.title} |
| 85 | + </h1> |
| 86 | + <div className="flex items-center gap-2 sm:gap-3 flex-wrap"> |
| 87 | + <Badge |
| 88 | + variant={statusVariant[kit.status]} |
| 89 | + className="text-sm px-3 py-1" |
| 90 | + > |
77 | 91 | {kit.status} |
78 | 92 | </Badge> |
79 | | - <Badge variant="outline" className="text-xs"> |
| 93 | + <Badge variant="outline" className="text-sm px-3 py-1"> |
80 | 94 | {kit.category} |
81 | 95 | </Badge> |
| 96 | + <div className="flex items-center gap-2 text-sm text-muted-foreground"> |
| 97 | + <Calendar className="h-4 w-4" /> |
| 98 | + <span> |
| 99 | + Updated {new Date(kit.lastUpdated).toLocaleDateString()} |
| 100 | + </span> |
| 101 | + </div> |
82 | 102 | </div> |
83 | | - <h1 className="text-2xl font-bold tracking-tight sm:text-3xl md:text-4xl lg:text-5xl"> |
84 | | - {kit.title} |
85 | | - </h1> |
86 | 103 | <p className="text-base sm:text-lg text-muted-foreground leading-relaxed"> |
87 | 104 | {kit.summary} |
88 | 105 | </p> |
89 | 106 | </div> |
90 | 107 |
|
91 | | - {/* Metadata row */} |
92 | | - <div className="flex flex-wrap gap-3 sm:gap-4 items-center text-sm text-muted-foreground"> |
93 | | - <Button asChild variant="default" size="sm"> |
| 108 | + {/* Experimental Warning */} |
| 109 | + {kit.status === "experimental" && ( |
| 110 | + <div className="rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900/50 dark:bg-amber-950/20"> |
| 111 | + <div className="flex gap-3"> |
| 112 | + <AlertCircle className="h-5 w-5 text-amber-600 dark:text-amber-500 shrink-0 mt-0.5" /> |
| 113 | + <div className="space-y-1"> |
| 114 | + <p className="text-sm font-medium text-amber-900 dark:text-amber-200"> |
| 115 | + Experimental Release |
| 116 | + </p> |
| 117 | + <p className="text-sm text-amber-800 dark:text-amber-300"> |
| 118 | + This kit is under active development. APIs may change |
| 119 | + without notice. Not recommended for production use. |
| 120 | + </p> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + </div> |
| 124 | + )} |
| 125 | + |
| 126 | + {/* Deprecated Warning */} |
| 127 | + {kit.status === "deprecated" && ( |
| 128 | + <div className="rounded-lg border border-red-200 bg-red-50 p-4 dark:border-red-900/50 dark:bg-red-950/20"> |
| 129 | + <div className="flex gap-3"> |
| 130 | + <AlertCircle className="h-5 w-5 text-red-600 dark:text-red-500 shrink-0 mt-0.5" /> |
| 131 | + <div className="space-y-1"> |
| 132 | + <p className="text-sm font-medium text-red-900 dark:text-red-200"> |
| 133 | + Deprecated |
| 134 | + </p> |
| 135 | + <p className="text-sm text-red-800 dark:text-red-300"> |
| 136 | + This kit is no longer maintained. Consider migrating to an |
| 137 | + alternative solution. |
| 138 | + </p> |
| 139 | + </div> |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + )} |
| 143 | + |
| 144 | + {/* Metadata */} |
| 145 | + <div className="flex flex-col sm:flex-row sm:items-center gap-3"> |
| 146 | + <Button asChild variant="outline" size="sm"> |
94 | 147 | <a |
95 | 148 | href={kit.reference.url} |
96 | 149 | target="_blank" |
97 | 150 | rel="noopener noreferrer" |
| 151 | + className="flex items-center gap-2" |
98 | 152 | > |
99 | | - <ExternalLink className="mr-2 h-3 w-3 sm:h-4 sm:w-4" /> |
100 | | - <span className="text-xs sm:text-sm"> |
| 153 | + <ExternalLink className="h-4 w-4" /> |
| 154 | + <span className="text-sm"> |
101 | 155 | {kit.reference.type === "repo" |
102 | 156 | ? "Repository" |
103 | 157 | : "Documentation"} |
104 | 158 | </span> |
105 | 159 | </a> |
106 | 160 | </Button> |
107 | | - <div className="flex items-center gap-1.5 text-xs sm:text-sm"> |
108 | | - <Calendar className="h-3 w-3 sm:h-4 sm:w-4" /> |
109 | | - <span> |
110 | | - Updated {new Date(kit.lastUpdated).toLocaleDateString()} |
111 | | - </span> |
112 | | - </div> |
113 | 161 | </div> |
114 | 162 |
|
115 | | - {/* Tags */} |
116 | | - {kit.tags.length > 0 && ( |
117 | | - <div className="flex flex-wrap gap-1.5 sm:gap-2"> |
118 | | - {kit.tags.map((tag: string) => ( |
119 | | - <Badge key={tag} variant="outline" className="text-xs"> |
120 | | - {tag} |
121 | | - </Badge> |
122 | | - ))} |
123 | | - </div> |
124 | | - )} |
125 | | - |
126 | 163 | <Separator /> |
127 | 164 |
|
128 | 165 | {/* MDX Content */} |
129 | | - <div className="max-w-none"> |
| 166 | + <div className="max-w-full overflow-x-hidden break-words"> |
130 | 167 | <MDXContent code={kit.body} /> |
131 | 168 | </div> |
132 | 169 | </div> |
|
0 commit comments