// components/NavigationToggle.jsx
import React from 'react';
import { Box, Typography } from '@mui/material';
import { PrimaryOutlinedButton } from './Buttons/Buttons'; // Ваш компонент кнопки

const NavigationToggle = ({ currentView, onViewChange }) => {
    const handleNavigateToTasks = () => {
        onViewChange('/tasks');
    };

    const handleNavigateToProjects = () => {
        onViewChange('/projects');
    };

    return (
        <Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5 }}>
            {currentView === 'tasks' ? (
                <PrimaryOutlinedButton onClick={handleNavigateToProjects}>
                    ← К проектам
                </PrimaryOutlinedButton>
            ) : (
                <PrimaryOutlinedButton onClick={handleNavigateToTasks}>
                    ← К задачам
                </PrimaryOutlinedButton>
            )}
            <Typography variant="h6" color="primary" sx={{ fontWeight: 200, fontSize: '1rem' }}>
                {currentView === 'tasks' ? 'Управление задачами' : 'Управление проектами'}
            </Typography>
        </Box>
    );
};

export default NavigationToggle;