import { Link } from 'react-router-dom'
import { Navbar } from 'react-bootstrap'

import BackButton from '../assets/backArrow.svg'
import { PropsWithChildren } from 'react'

type BackHeaderProps = {
    text: string
}

function BackHeader({ text, children }: PropsWithChildren<BackHeaderProps>) {
    return (
        <Navbar>
            <Navbar.Brand as={Link} to='/'>
                <img src={BackButton} alt='Назад' />
            </Navbar.Brand>
            <Navbar.Text className='me-auto'>
                <h4 className='mb-0'>
                    {text}
                </h4>
            </Navbar.Text>
            {children}
        </Navbar>
    )
}

export default BackHeader
