lthn.io/resources/views/components/toc.blade.php
Claude 77cc45dd83
feat: lthn.io CorePHP app — TLD website + blockchain services
Modules:
- Chain: daemon RPC client (DaemonRpc singleton, cached queries)
- Explorer: block browser, tx viewer, alias directory, search, stats API
- Names: .lthn TLD registrar portal (availability check, lookup, directory)
- Trade: scaffold (DEX frontend + API)
- Pool: scaffold (mining pool dashboard)

Replaces 5 Node.js containers (5.9GB) with one FrankenPHP app.
Built on CorePHP framework pattern from host.uk.com.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-03 16:13:55 +01:00

49 lines
1.6 KiB
PHP

@props([
'items' => [],
])
{{--
Table of Contents Component
Usage:
<x-toc :items="[
['id' => 'introduction', 'label' => 'Introduction'],
['id' => 'getting-started', 'label' => 'Getting Started', 'children' => [
['id' => 'installation', 'label' => 'Installation'],
['id' => 'configuration', 'label' => 'Configuration'],
]],
]" />
Or manually:
<x-slot:toc>
<x-toc-link href="#introduction">Introduction</x-toc-link>
<x-toc-link href="#getting-started">Getting Started</x-toc-link>
</x-slot:toc>
--}}
@if(count($items) > 0)
<ul class="space-y-1">
@foreach($items as $item)
<li>
<a href="#{{ $item['id'] }}"
class="toc-link block py-1 pl-3 border-l-2 border-slate-700 text-slate-400 hover:text-white hover:border-purple-500 transition-colors">
{{ $item['label'] }}
</a>
@if(isset($item['children']) && count($item['children']) > 0)
<ul class="mt-1 ml-3 space-y-1">
@foreach($item['children'] as $child)
<li>
<a href="#{{ $child['id'] }}"
class="toc-link block py-1 pl-3 border-l-2 border-slate-700 text-slate-500 text-sm hover:text-white hover:border-purple-500 transition-colors">
{{ $child['label'] }}
</a>
</li>
@endforeach
</ul>
@endif
</li>
@endforeach
</ul>
@else
{{ $slot }}
@endif