website/src/components/cards/docs.jsx

20 lines
625 B
React
Raw Normal View History

2022-08-26 13:46:21 +00:00
import React from "react";
import { Link } from "gatsby";
import { node2slug } from "../../utils";
2022-08-28 09:59:41 +00:00
const DocsCard = ({ md, width }) => {
2022-08-26 13:46:21 +00:00
2022-08-28 09:59:41 +00:00
return <article className={"card card bg-base-200 shadow-xl mx-10 mb-5 " + (width || "w-full md:w-2/3")}>
2022-08-26 13:46:21 +00:00
<div className="card-body">
<h2 className="card-title">{md.frontmatter.title}</h2>
<p>
{md.excerpt}
</p>
<div className="card-actions justify-end">
<Link to={node2slug(md)} className="btn btn-primary">View</Link>
</div>
</div>
</article>
}
export default DocsCard