Portfolio/front/Tabs/Project.ts

34 lines
2 KiB
TypeScript
Raw Normal View History

import { link } from "ansi-escapes";
import { newLine } from "..";
interface ProjectProps {
title: string;
description: string;
technologies: string[];
learnMoreLink: string;
}
const Project = ({ title, description, technologies, learnMoreLink }: ProjectProps) => {
return (
` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓${newLine}` +
`\x1b[33m${title.padEnd(80 - 4)}\x1b[0m ┃${newLine}` +
` ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫${newLine}` +
description
.split(newLine)
.map((line) => `${line.padEnd(80 - 4)}${newLine}`)
.join("") +
` ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫${newLine}` +
` ┃ Technologies: \x1b[34m${technologies.join(", ").padEnd(80 - 18)}\x1b[0m ┃${newLine}` +
` ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫${newLine}` +
`${link(
" \x1b[32mLearn more\x1b[0m ",
learnMoreLink
)}${newLine}` +
` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛${newLine}`
);
};
export default Project;
export type { ProjectProps };