Delete MainComponent.tsx

This commit is contained in:
Tatyana Nikolaeva 2025-04-28 07:16:36 +00:00
parent 31c4ff6a2a
commit a28eca4da9

View file

@ -1,29 +0,0 @@
import Navigation from "../Navigation/Navigation.tsx";
import React, {useState} from "react";
import styles from './MainComponent.module.css'
import Survey from "../Survey/Survey.tsx";
import SettingSurvey from "../SettingSurvey/SettingSurvey.tsx";
const MainComponent: React.FC = () => {
const [activePage, setActivePage] = useState(
localStorage.getItem("activePage") || "Вопросы"
);
const handleNavigationClick = (title: string) => {
setActivePage(title);
localStorage.setItem('activePage', title);
}
return (
<main className={styles.mainPage}>
<Navigation
activePage={activePage}
onNavigationClick={handleNavigationClick}
/>
{ activePage === 'Вопросы' && <Survey />}
{activePage === 'Настройки' && <SettingSurvey />}
</main>
)
}
export default MainComponent;