mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-25 05:35:48 +00:00
* feat: rtl * feat * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * feat: add sidebar * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * chore: changeset * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix
35 lines
956 B
TypeScript
35 lines
956 B
TypeScript
import Link from "next/link"
|
|
|
|
import { PAGES_NEW } from "@/lib/docs"
|
|
import { getPagesFromFolder, type PageTreeFolder } from "@/lib/page-tree"
|
|
|
|
export function ComponentsList({
|
|
componentsFolder,
|
|
currentBase,
|
|
}: {
|
|
componentsFolder: PageTreeFolder
|
|
currentBase: string
|
|
}) {
|
|
const list = getPagesFromFolder(componentsFolder, currentBase)
|
|
|
|
return (
|
|
<div className="grid grid-cols-2 gap-4 md:grid-cols-3 md:gap-x-8 lg:gap-x-16 lg:gap-y-6 xl:gap-x-20">
|
|
{list.map((component) => (
|
|
<Link
|
|
key={component.$id}
|
|
href={component.url}
|
|
className="inline-flex items-center gap-2 text-lg font-medium underline-offset-4 hover:underline md:text-base"
|
|
>
|
|
{component.name}
|
|
{PAGES_NEW.includes(component.url) && (
|
|
<span
|
|
className="flex size-2 rounded-full bg-blue-500"
|
|
title="New"
|
|
/>
|
|
)}
|
|
</Link>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|