<?php

namespace App\Filament\App\Pages;

use App\Filament\App\Widgets\CashFlowChart;
use App\Filament\App\Widgets\CustomerOverview;
use App\Filament\App\Widgets\ExpenseBreakdownChart;
use App\Filament\App\Widgets\RecentTransactionsTable;
use App\Filament\App\Widgets\UpcomingFollowUpsTable;
use Filament\Actions\Action;
use Filament\Pages\Dashboard;
use Filament\Support\Icons\Heroicon;

class AppDashboard extends Dashboard
{
    protected static ?string $title = 'Flowieons Intelligence';

    protected static string|\BackedEnum|null $navigationIcon = Heroicon::OutlinedHome;

    public function getColumns(): int|array
    {
        return 12;
    }

    public function getWidgets(): array
    {
        return [
            CustomerOverview::class,
            CashFlowChart::class,
            ExpenseBreakdownChart::class,
            UpcomingFollowUpsTable::class,
            RecentTransactionsTable::class,
        ];
    }

    protected function getHeaderActions(): array
    {
        return [
            Action::make('onboarding')
                ->label('First Setup')
                ->icon(Heroicon::OutlinedSparkles)
                ->url(Onboarding::getUrl(panel: 'app')),
            Action::make('smartEntry')
                ->label('Smart Entry')
                ->icon(Heroicon::OutlinedMicrophone)
                ->url(SmartEntry::getUrl(panel: 'app')),
            Action::make('reports')
                ->label('Reports')
                ->icon(Heroicon::OutlinedChartBarSquare)
                ->url(Reports::getUrl(panel: 'app')),
            Action::make('transactions')
                ->label('Manual Entry')
                ->icon(Heroicon::OutlinedPlusCircle)
                ->url(\App\Filament\App\Resources\Transactions\TransactionResource::getUrl(panel: 'app')),
        ];
    }
}
