import { Truck } from 'iconsax-react'
import { type FC } from 'react'
import SubMenuItem from './SubMenuItem'
import { Pages } from '../../config/Pages'

const ShippingSubMenu: FC = () => {

    const isActive = (name: string) => {
        return location.pathname.includes(name)
    }

    return (
        <div className='py-12'>
            <div className='flex gap-3 items-center border-b border-border pb-10 px-6'>
                <Truck
                    size={24}
                    color='#000'
                    variant='Bold'
                />
                <div className='text-xs'>
                    روش های ارسال
                </div>
            </div>

            <div className='flex flex-col mt-10 gap-4'>
                <SubMenuItem
                    title={'لیست روش های ارسال'}
                    isActive={isActive('list')}
                    link={Pages.shipment.list}
                />
                <SubMenuItem
                    title={'ایجاد روش ارسال'}
                    isActive={isActive('create')}
                    link={Pages.shipment.create}
                />
            </div>

        </div>
    )
}

export default ShippingSubMenu
