import { AppstoreOutlined, BarsOutlined, BranchesOutlined, CopyOutlined, DatabaseOutlined, DiffOutlined, FileSearchOutlined, ForkOutlined, FormOutlined, LinkOutlined, MailOutlined, PictureOutlined, PlusOutlined, SettingOutlined, ShareAltOutlined, SnippetsOutlined, TableOutlined, TagsOutlined, ToolOutlined, FileDoneOutlined } from '@ant-design/icons';
import { IAppMenu } from 'lemans-common/components/HeaderMenu/HeaderMenu.types';
import { isUS } from 'lemans-dashboard-common/Config/Config.env';

export const lemansDashboardDigitalServicesMenu:IAppMenu[] = [{
    Icon: <DatabaseOutlined />,
    key: "ds",
    menus: [{
        Icon: <FormOutlined />,
        key: "overview",
        permissions: "cascade",
        subItems: [
            {
                Icon: <SnippetsOutlined />,
                key:'overview:1',
                permissions: ['ds.adminOverview.view'],
                title: 'Admin Summary',
                to: `/digital-services/admin-summary`,
            },
            {
                Icon: <DiffOutlined />,
                key:'overview:2',
                permissions: ['ds.executiveOverview.view'],
                title: 'Executive Overview',
                to: `/digital-services/executive-overview`,
            },
            {
                Icon: <CopyOutlined />,
                key:'overview:3',
                permissions: ['ds.userOverview.view'],
                title: 'Category Specialist',
                to: `/digital-services/category-specialist-summary`,
            },
            {
                Icon: <FileDoneOutlined />,
                key:'overview:4',
                permissions: ['qcsummary.application.view'],
                title: 'QC Summary',
                to: `/digital-services/qc-summary`,
            }
        ],
        title: "Overview",
        to: "/digital-services/overview",
    },{        
        Icon: <BarsOutlined />,
        key: "queues",
        permissions: "cascade",
        subItems: [
            {
                Icon: <LinkOutlined />,
                key:'queues:1',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts without a Category',
                to: `/digital-services/queue/parts-without-category?filterType=partsWithoutCategory&isDigiActive=1`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:2',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts without a Product',
                to: `/digital-services/queue/parts-without-product?filterType=PartsWithoutProduct&isDigiActive=1`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:3',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts without Attribute Values',
                to: `/digital-services/queue/parts-without-attribute-values?${isUS ? 'isDigiActive=1&' : ''}filterType=PartsWithoutAttributeValue`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:4',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts without Media',
                to: `/digital-services/queue/parts-without-media?filterType=partsWithoutMedia&warehouse=02&isDigiActive=1`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:5',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Photo reshoots',
                to: `/digital-services/queue/photo-reshoot?filterType=PART_PHOTO_SHOOT&warehouse=02&isDigiActive=1&tagId=!28&tagId=!33&tagId=!34`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:6',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts without Fitment',
                to: `/digital-services/queue/parts-without-fitment?filterType=partsWithoutFitment&isDigiActive=1`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:7',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Parts with Missing Fitment Years',
                to: `/digital-services/queue/missing-fitment-years?isDigiActive=1`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:8',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Products without Media',
                to: `/digital-services/queue/products-without-media?${isUS ? 'isDigiActive=1&' : ''}filterType=productsWithoutMedia`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:9',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Products without Feature Text',
                to: `/digital-services/queue/products-without-feature-text?${isUS ? 'isDigiActive=1&' : ''}filterType=productsWithoutFeatureText`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:10',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Split Products',
                to: `/digital-services/queue/split-product?${isUS ? 'isDigiActive=1&' : ''}flagId=20&mode=flag`,
            },
            {
                Icon: <TagsOutlined />,
                key:'queues:11',
                permissions: ['ds.part.view', 'ds.part.edit'],
                title: 'Ad-hoc Part Queue',
                to: `/digital-services/queue/ad-hoc`,
            }

        ],
        title: "Queues", 
        to: '.',
    },
    {        
        Icon: <FileSearchOutlined />,
        key: "partSearch",       
        permissions: ['ds.part.view', 'ds.part.edit'],
        title: "Part Search", 
        to: '/digital-services/part/?filterType=part&isDigiActive=1',
    },
    {        
        Icon: <DatabaseOutlined />,
        key: "products",
        permissions: "cascade",
        subItems: [
            {
                Icon: <FileSearchOutlined />,
                key:'products:1',
                permissions: ['ds.product.view', 'ds.product.edit'],
                title: 'Product Search',
                to: `/digital-services/product?isDigiActive=1&mode=flag`,
            },
            {
                Icon: <PlusOutlined />,
                key:'products:2',
                permissions: ['ds.product.edit'],
                title: 'Create New Product',
                to: `/digital-services/product/createProduct`,
            }
        ],
        title: "Products", 
        to: '.',
    },
    {        
        Icon: <ShareAltOutlined />,
        key: "categories",
        permissions: "cascade",
        subItems: [
            {
                Icon: <AppstoreOutlined />,
                key:'categories:1',
                permissions: ['ds.category.view', 'ds.category.edit'],
                title: 'Categories',
                to: `/digital-services/category`,
            },
            {
                Icon: <PictureOutlined />,
                key:'categories:2',
                permissions: ['ds.publicationCategory.view', 'ds.publicationCategory.edit'],
                title: 'Publication Categories',
                to: `/digital-services/publication-category`,
            }
        ],
        title: "Categories", 
        to: '.',
    },
    {
        Icon: <PictureOutlined />,
        key: 'media',
        permissions: ['ds.media.view', 'ds.media.edit'],
        title: 'Media',
        to: `/digital-services/media?flagId=!22&isDigiActive=1&mode=flag&unassociated=1`
    },
    {
        Icon: <PictureOutlined />,
        key: 'studioOrder',
        permissions: ['ds.studioOrder.view', 'ds.studioOrder.edit'],
        title: 'Studio Orders',
        to: `/digital-services/studio-orders`
    },
    {
        Icon: <PictureOutlined />,
        key: 'fitmentCompare',
        permissions: ['ds.part.edit'],
        title: 'Fitment Comparison Tool',
        to: `/digital-services/fitment-compare`
    },
    {        
        Icon: <ToolOutlined />,
        key: "maintenance",
        permissions: "cascade",
        subItems: [
            {
                Icon: <SettingOutlined />,
                key:"maintenance:0",
                permissions: ['ds.brand.edit', 'ds.brand.view'],
                title: "Brands",
                to: `/digital-services/brand`,
            },
            {
                Icon: <SettingOutlined />,
                key:"maintenance:1",
                permissions: ['ds.part.edit'],
                title: "Bulk Fitment Assignment/Deletion",
                to: `/digital-services/maintenance/bulkFitmentAssignment`,
            },
            {
                Icon: <ForkOutlined />,
                key:'maintenance:2',
                permissions: ['ds.attribute.edit', 'ds.attribute.view', 'ds.attribute.locale.edit'],
                title: 'Attribute Name',
                to: `/digital-services/maintenance/attributeName`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:3',
                permissions: ['ds.attribute.edit', 'ds.attribute.view', 'ds.attribute.locale.edit'],
                title: 'Attribute Value',
                to: `/digital-services/maintenance/attributeValue`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:4',
                permissions: ['ds.mmy.edit', 'ds.mmy.view', 'ds.mmy.year.edit'],
                title: 'Make/Model/Year',
                to: `/digital-services/maintenance/fitment`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:5',
                permissions: ['ds.import.edit'],
                title: 'Import',
                to: `/digital-services/maintenance/import`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:5.1',
                permissions: ['ds.part.certification.edit'],
                title: 'Bulk Certification',
                to: `/digital-services/bulk-certification`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:6',
                permissions: ['ds.explosionDiagram.edit','ds.explosionDiagram.view'],
                title: 'Explosion Diagrams',
                to: `/digital-services/maintenance/explosionDiagram`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:7',
                permissions: ['ds.user.category.edit', 'ds.user.category.view'],
                title: 'Category Assignment',
                to: `/digital-services/maintenance/category-assignment`,
            },
            {
                Icon: <TableOutlined />,
                key:'maintenance:8',
                permissions: ['ds.sizeChart.view', 'ds.sizeChart.edit'],
                title: 'Size Charts',
                to: `/digital-services/maintenance/size-chart`,
            },
            {
                Icon: <BranchesOutlined />,
                key:'maintenance:9',
                permissions: ['ds.synonym.view', 'ds.synonym.edit'],
                title: 'Synonyms',
                to: `/digital-services/maintenance/synonyms`,
            },
            {
                Icon: <MailOutlined />,
                key:'maintenance:10',
                permissions: ['common.emailConfiguration.edit'],
                title: 'Studio Email Configuration',
                to: `/digital-services/maintenance/email-configuration`,
            },
            {
                Icon: <TableOutlined />,
                key:'maintenance:11',
                permissions: ['ds.catalogInstance.edit', 'ds.catalogInstance.view'],
                title: 'Catalog',
                to: `/digital-services/maintenance/catalog-flipper-maintenance?tagId=!82`,
            },
        ],
        title: "Maintenance", 
        to: '.',
    }],
    name: "Digital Services",
    permission: 'ds.application.view',
    to: "/digital-services/?filterType=part&isDigiActive=1",
}];
