import Image from "next/image"; import { getThemeAuthorLink, ZenTheme } from "@/lib/themes"; import styled from "styled-components"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog";import { Button } from "./ui/button"; import { ny } from "@/lib/utils"; const ThemeCardWrapper = styled.div` `; export default function ThemeCard({ theme, className }: { theme: ZenTheme; className?: string; }) { const maxNameLen = 50; const maxDescLen = 100; return ( { if (event.target instanceof HTMLAnchorElement) return; window.open(`/themes/${theme.id}`, "_self"); }} className={ny("flex flex-col justify-start p-5 rounded-lg shadow-sm bg-muted dark:bg-muted/50 border border-grey-900 dark:border-muted w-full hover:shadow-lg transition duration-300 ease-in-out hover:bg-muted/100 hover:border-blue-500 cursor-pointer select-none ", className)}> {theme.name}

{theme.name.substring(0, maxNameLen).trim() + (theme.name.length > maxNameLen ? "..." : "")}

{theme.homepage && ( <> Homepage {"ยท"} )} Author

{theme.description.substring(0, maxDescLen).trim() + (theme.description.length > maxDescLen ? "..." : "")}

); }