feat: Add themes marketplace page and components

This commit is contained in:
Mauro Balades
2024-08-14 23:12:22 +02:00
parent ca1540a6c5
commit f16a46a290
8 changed files with 268 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
"use client";
import React from "react";
import ThemesSearch from "./themes-search";
import { getAllThemes, getThemesFromSearch, ZenTheme } from "@/lib/themes";
import ThemeCard from "./theme-card";
export default function MarketplacePage() {
const [searchInput, setSearchInput] = React.useState("");
const [themes, setThemes] = React.useState<ZenTheme[]>([]);
React.useEffect(() => {
setThemes(getAllThemes());
}, []);
return (
<div className="flex flex-col w-1/2 items-center justify-center h-full mt-36">
<div className="mx-auto w-full text-center">
<h1 className="text-7xl font-bold">Themes Marketplace</h1>
<ThemesSearch input={searchInput} setInput={setSearchInput} />
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-8 mt-10 w-full">
{getThemesFromSearch(themes, searchInput).map((theme) => (
<ThemeCard key={theme.name} theme={theme} />
))}
</div>
</div>
);
}