<?php

namespace App\Nova\Dashboards;

use App\Models\User;
use App\Nova\Resources\Ecommerce\Product\Order\Metrics\NewOrders;
use App\Nova\Resources\Ecommerce\Product\Order\Metrics\OrdersPerStatus;
use App\Nova\Resources\Ecommerce\Product\Order\Metrics\ProductSoldPerDay;
use Laravel\Nova\Dashboards\Main as Dashboard;

class Main extends Dashboard
{
    /**
     * Get the displayable name of the dashboard.
     */
    public function name(): string
    {
        return __('Panel');
    }

    /**
     * Get the cards for the dashboard.
     *
     * @return array
     */
    public function cards()
    {
        return [
            NewOrders::make()->canSeeWhen('isAdmin', User::class),
            ProductSoldPerDay::make()->canSeeWhen('isAdmin', User::class),
            OrdersPerStatus::make()->canSeeWhen('isAdmin', User::class),
        ];
    }
}
