import {__} from "../globals";
import {createContext} from "react";

export const suggestedScopes = [
    {
        id: 'bogo',
        label: 'Buy One, Get One',
        description: __('Bogo offers on the same product or across different products, categories, brands, tags, attributes and more.'),
        examples: [
            __('Buy 1 of Product A, get another for free'),
            __('Buy 1 in Category, get another for free'),
            __('Buy 1 Product A, get Product B'),
            __('Buy 1 Category A, get Category B'),
        ]
    },
    {
        id: 'item_discounts',
        label: 'Item Discounts',
        examples: [
            __('10% off Product A'),
            __('$5 off Categories A, B, C'),
            __('12% off Categories A or B. Min. qty 2+'),

        ]
    },
    {
        id: 'cart_discounts',
        label: 'Cart Discounts',
        examples: [
            __('10% storewide discount'),
            __('$20 off when buying Product A'),
        ]
    },
    {
        id: '',
        label: 'Not Sure / Other',
        examples: [
            __('Other offers not listed above'),
        ]
    }
    /*{
        id: 'or_inclusive',
        label: 'Advanced Selection of Products',
        examples: [
            __('Any 1 of Product A, B, C AND/OR Category X, Y, Z'),
        ]
    },
    {
        id: 'and',
        label: 'Mix and Match Pairing (Combos / Bundles)',
        examples: [
            __('1 of Product A + 1 of Product B'),
            __('2 in Category A + 1 of Product B'),
        ]
    },*/
]

export const getSuggestedScopeById = (id: string) => {
    return suggestedScopes.find(scope => scope.id === id);
}

export const SuggestedScopeContext = createContext<typeof suggestedScopes[number]['id'] | string>('')