Portfolio/front/Tabs/TabRouter.ts

22 lines
576 B
TypeScript

import About from "./About";
import Contact from "./Contact";
import Projects from "./Projects";
interface TabRouterProps {
width: number;
height: number;
selectedTab: "About" | "Projects" | "Contact";
scrollPosition: number;
}
const TabRouter = ({ width, height, selectedTab, scrollPosition }: TabRouterProps) => {
switch (selectedTab) {
case "About":
return About({ width, height, scrollPosition });
case "Projects":
return Projects({ width, height, scrollPosition });
case "Contact":
return Contact({ width, height });
}
};
export default TabRouter;