Portfolio/front/index.ts

35 lines
851 B
TypeScript
Raw Normal View History

2025-03-12 08:17:34 +01:00
import Categories from "./Categories";
import Header from "./Header";
import TabRouter from "./Tabs/TabRouter";
interface FrontProps {
columns: number;
rows: number;
selectedTab: "About" | "Projects" | "Contact";
}
const terminalTooSmall = (width: number, height: number) => {
return (
`Oh no! Your terminal window is too small!${newLine}` +
`Minimum size required: 60x20` +
`Current size: ${width}x${height}`
);
};
const Front = ({ columns, rows, selectedTab }: FrontProps) => {
if (columns < 60 || rows < 20) {
return terminalTooSmall(columns, rows);
}
return (
`${Header({ width: columns, height: 3 })}${newLine}` +
`${Categories({ width: columns, height: 3, selectedTab })}${newLine}` +
`${TabRouter({ width: columns, height: 3, selectedTab })}`
);
};
const newLine = "\n\r";
export default Front;
export { newLine };