<?php

namespace BWDK\Core;

use BWDK\Admin\Assets as AdminAssets;
use BWDK\Admin\SettingsPage;
use BWDK\API\AjaxHandler;
use BWDK\Front\Assets as FrontAssets;
use BWDK\Integrations\Digify\Routes\CallbackRoute;
use BWDK\Woo\Order\OrderListColumns;
use BWDK\Woo\Order\OrderMetabox;
use BWDK\Woo\WooHooks;

class ServiceProvider
{
    public function register(): void
    {

        App::bind(AjaxHandler::class, new AjaxHandler());
        App::get(AjaxHandler::class)->register();

        App::bind(CallbackRoute::class, new CallbackRoute());
        App::get(CallbackRoute::class)->register();

        if (is_admin()) {

            App::bind(SettingsPage::class, new SettingsPage());
            App::bind(AdminAssets::class, new AdminAssets());

            App::get(SettingsPage::class)->register();
            App::get(AdminAssets::class)->register();


            App::bind(OrderListColumns::class, new OrderListColumns());
            App::get(OrderListColumns::class)->register();

            App::bind(OrderMetabox::class, new OrderMetabox());
            App::get(OrderMetabox::class)->register();





        } else {


            App::bind(FrontAssets::class, new FrontAssets());
            App::get(FrontAssets::class)->register();



            App::bind(WooHooks::class, new WooHooks());
            App::get(WooHooks::class)->register();





        }

    }
}
