import React from "react"; import { graphql } from "gatsby"; import { Trans, useTranslation } from "gatsby-plugin-react-i18next"; import Layout from "../layouts/default"; import PropTypes from "prop-types"; import * as styles from "./project.module.scss"; import { GatsbyImage } from "gatsby-plugin-image"; import { ExternalLink, Github } from "lucide-react"; export const query = graphql` query GetProject($urlname: String!, $lang: String!, $language: String!) { allProjectsJson( filter: { urlname: { eq: $urlname }, lang: { eq: $lang } } ) { nodes { lang urlname name links { github website } image { childImageSharp { gatsbyImageData( placeholder: BLURRED layout: FULL_WIDTH ) } publicURL } shortDescription } } locales: allLocale(filter: { language: { eq: $language } }) { edges { node { ns data language } } } file( sourceInstanceName: { eq: "projectTextblocks" } relativeDirectory: { eq: $urlname } name: { eq: $language } ) { id childMdx { body } name } } `; const ProjectTemplate = ({ data }) => { const { t, i18n } = useTranslation(); let project = data.allProjectsJson.nodes[0]; let projectName = project.name; let file = data.file; const lang = i18n.language; return (

project.title: {projectName}

{project.shortDescription}
{file != null && file.childMdx != null ? (() => { // TODO: This. })() : null} {project.links !== null ? (

Links

{project.links.github !== null ? ( {" "} project.viewGitHub ) : null} {project.links.website !== null ? ( {" "} project.viewWebsite ) : null}
) : null}
); }; ProjectTemplate.propTypes = { data: PropTypes.object.isRequired, }; export default ProjectTemplate;