import React from "react"; import Layout from "../components/Layout"; import CtaMini from "../components/CtaMini"; import { graphql, Link } from "gatsby"; import { AllTagsInfo } from "../models/all-tags-description.model"; type TagsProps = AllTagsInfo; const Tags: React.FC = ({ data }) => { const { allGhostTag } = data; return (

{allGhostTag.edges.length > 0 ? "Tags" : "No tags available."}

{allGhostTag.edges.length > 0 && (
{allGhostTag.edges.map(({ node }, i) => { return (
{node.name[0]}

{node.name}

{node.postCount} {node.postCount > 1 ? "posts" : "post"}
); })}
)}
); }; export default Tags; export const TagsQuery = graphql` query { allGhostTag { edges { node { name slug postCount } } } } `;