<?php

namespace App\Filament\Pages\Integrations;

use BackedEnum;
use Filament\Pages\Page;
use UnitEnum;
use Livewire\Attributes\Computed;
use Illuminate\Http\Request;

class KnowledgeGraphExplorer extends Page
{
    protected static ?string $title = '知识图谱浏览';
    protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-globe-alt';
    protected static ?string $navigationLabel = '知识图谱浏览';
    protected static string|UnitEnum|null $navigationGroup = '知识图谱管理';
    protected static ?int $navigationSort = 6;
    protected string $view = 'filament.pages.integrations.knowledge-graph-explorer';

    public ?string $selectedKpCode = null;
    protected ?string $subheading = '点击任意节点查看详细信息，包括子知识点和技能点';

    public function mount(Request $request): void
    {
        $this->selectedKpCode = $request->query('kp_code');
    }

    public function getBreadcrumbs(): array
    {
        return [
            url('/admin') => '首页',
            0 => '知识图谱浏览', // 当前页不做链接，避免重复点击
        ];
    }
}
