import React from 'react';
import { Link } from 'react-router-dom';

/**
 * 面包屑导航组件
 */
const Breadcrumb = ({ knowledgeBase, activeTab }) => {
    return (
        <div className='d-flex align-items-center mb-4 mt-3'>
            <nav aria-label='breadcrumb'>
                <ol className='breadcrumb mb-0'>
                    <li className='breadcrumb-item'>
                        <Link className='text-secondary text-decoration-none' to='/'>
                            知识库
                        </Link>
                    </li>
                    <li className='breadcrumb-item'>
                        <Link
                            className='text-secondary text-decoration-none'
                            to={`/knowledge-base/${knowledgeBase.id}`}
                        >
                            {knowledgeBase.name}
                        </Link>
                    </li>
                    <li className='breadcrumb-item active text-dark' aria-current='page'>
                        {activeTab === 'datasets' ? '数据集' : '设置'}
                    </li>
                </ol>
            </nav>
        </div>
    );
};

export default Breadcrumb;
