import GithubIcon from '@assets/images/social-media/github.svg'; import GitlabIcon from '@assets/images/social-media/gitlab.svg'; import { config } from '@config/website'; import { t } from '@lingui/macro'; import { ProjectMeta } from '@ts/types/app'; import { getFormattedDate } from '@utils/helpers/format'; import { slugify } from '@utils/helpers/slugify'; import useGithubApi from '@utils/hooks/useGithubApi'; import Image from 'next/image'; import { useRouter } from 'next/router'; import styles from './ProjectSummary.module.scss'; const ProjectSummary = ({ title, cover, meta, }: { title: string; cover: string; meta: ProjectMeta; }) => { const { license, repos, technologies } = meta; const router = useRouter(); const locale = router.locale ? router.locale : config.locales.defaultLocale; const { data } = useGithubApi(repos?.github ? repos.github : ''); return (
{cover && (
{t`${title}
)}
{data && (
{t`Created on`}
)} {data && (
{t`Last updated on`}
)}
{t`License`}
{license}
{technologies && (
{t`Technologies`}
{technologies.map((techno) => (
{techno}
))}
)} {repos && (
{t`Repositories`}
{repos.github && (
Github
)} {repos.gitlab && (
Gitlab
)}
)} {data && repos && (
{t`Popularity`}
{repos.github && (
⭐  {t`${data.stargazers_count} stars on Github`}
)}
)}
); }; export default ProjectSummary;