import { useNavigate } from "react-router-dom" import { cn } from "@/lib/utils" const SIZE_STYLES = { lg: { wrap: "space-y-4", grid: "grid-cols-3 gap-4", card: "gap-3 p-3", title: "text-sm", titleGap: "gap-2", desc: "text-xs mt-1", tag: "px-2 py-0.5", footer: "gap-3 pt-3", footerLink: "text-sm", }, sm: { wrap: "space-y-3", grid: "grid-cols-3 gap-3", card: "gap-2 p-2", title: "text-xs", titleGap: "gap-1.5", desc: "text-[11px] mt-0.5", tag: "px-1.5 py-0.5", footer: "gap-2 pt-2", footerLink: "text-xs", }, } as const export default function ProductDropdown({ size = "lg", onNavigate, }: { size?: keyof typeof SIZE_STYLES onNavigate?: () => void }) { const navigate = useNavigate() const s = SIZE_STYLES[size] const handleClick = (path: string) => { navigate(path) onNavigate?.() } return (
handleClick("/product")} /> window.open("https://lanhuip.com", "_blank")} /> handleClick("/product/http")} /> handleClick("/product/routeros")} /> window.open("http://vps.juip.com", "_blank")} />
热门推荐: |
) } function ProductCard({ size, title, desc, tag, onClick, }: { size: (typeof SIZE_STYLES)[keyof typeof SIZE_STYLES] title: string desc: string tag?: string onClick: () => void }) { return ( ) }