import { Card, Rate, Tag, Typography, Button } from "antd"; import { PlayCircleOutlined, TeamOutlined, } from "@ant-design/icons"; import { PostDto, TaxonomySlug } from "@nice/common"; import { useNavigate } from "react-router-dom"; interface pathCardProps { path: PostDto; } const { Title, Text } = Typography; export default function PathCard({ path }: pathCardProps) { const navigate = useNavigate(); const handleClick = (path: PostDto) => { navigate(`/path/editor/${path.id}`); window.scrollTo({ top: 0, behavior: "smooth", }) }; return ( handleClick(path)} key={path.id} hoverable className="group overflow-hidden rounded-xl border border-gray-200 bg-white shadow-xl hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-2" cover={
{/*
*/}
}>
{path?.terms?.map((term) => { return ( {term.name} ); })}
<button> {path.title}</button>
{path?.depts?.length > 1 ? `${path.depts[0].name}等` : path?.depts?.[0]?.name} {/* {path?.depts?.map((dept) => {return dept.name.length > 1 ?`${dept.name.slice}等`: dept.name})} */} {/* {path?.depts?.map((dept)=>{return dept.name})} */}
{path?.meta?.views ? `观看次数 ${path?.meta?.views}` : null}
); }