lthn.io/app/Mod/Names/Views/show.blade.php

97 lines
4.3 KiB
PHP

@extends('lethean::layout')
@section('title', $name . '.lthn')
@section('meta_description', $name . '.lthn — blockchain domain name registered on the Lethean network. ' . ($alias['comment'] ?? ''))
@section('content')
<div class="section">
<h2 style="margin-bottom: 0.25rem;"><span style="color: var(--accent);">{{ $name }}</span>.lthn</h2>
<p style="color: var(--muted); margin-bottom: 2rem;">Registered on the Lethean blockchain</p>
@php
$address = $alias['address'] ?? '';
$registrarWallets = [
'iTHNHN11yXMeBphpFSuHnDaSJ15QxiSEJXNY59VKbxKq4ype4xAH1PZHd1EKTknkPK9hHTu2G2tBBZzvrcRFaYMF8vWTzFZjGY' => '@LetheanRegistry',
'iTHNUNiuu3VP1yy8xH2y5iQaABKXurdjqZmzFiBiyR4dKG3j6534e9jMriY6SM7PH8NibVwVWW1DWJfQEWnSjS8n3Wgx86pQpY' => '@LetheanTestnet',
];
$isRegistryOwned = isset($registrarWallets[$address]);
$isPremium = !$isRegistryOwned && !empty($address);
$displayAddress = $registrarWallets[$address] ?? (strlen($address) > 20 ? substr($address, 0, 12) . '...' . substr($address, -12) : $address);
$comment = $alias['comment'] ?? '';
$parsed = [];
foreach (explode(';', $comment) as $pair) {
$parts = explode('=', $pair, 2);
if (count($parts) === 2) $parsed[$parts[0]] = $parts[1];
}
$type = $parsed['type'] ?? 'user';
$reason = $parsed['reason'] ?? '';
@endphp
<div class="card-grid">
<div class="card">
<h3>Owner</h3>
<p>
<code title="{{ $address }}" style="font-size: 0.9rem; color: var(--accent);">{{ $displayAddress }}</code>
</p>
<p style="margin-top: 0.5rem;">
@if($isPremium)
<span class="badge badge-amber" style="font-size: 0.75rem;">Community Member</span>
@elseif($isRegistryOwned)
<span class="badge badge-green" style="font-size: 0.75rem;">Registry Managed</span>
@endif
</p>
</div>
<div class="card">
<h3>Type</h3>
<p>
@if($type === 'reserved')
<span class="badge badge-amber">Reserved</span>
@if($reason) <span style="color: var(--muted); font-size: 0.85rem;">&mdash; {{ $reason }}</span> @endif
@elseif($type === 'gateway')
<span class="badge badge-green">Gateway</span>
@elseif($type === 'service')
<span class="badge badge-green">Service</span>
@else
<span class="badge badge-green">User</span>
@endif
</p>
</div>
</div>
@if(!empty($parsed['cap']))
<div class="card" style="margin-top: 1rem;">
<h3>Capabilities</h3>
<p>
@foreach(explode(',', $parsed['cap']) as $cap)
<span class="badge badge-green" style="margin-right: 0.25rem;">{{ $cap }}</span>
@endforeach
</p>
</div>
@endif
@if(!empty($parsed['hns']))
<div class="card" style="margin-top: 1rem;">
<h3>ITNS Sidechain</h3>
<p><code>{{ $parsed['hns'] }}</code></p>
</div>
@endif
@if($type === 'reserved')
<div class="card" style="margin-top: 1rem; border-left: 4px solid var(--amber); background: rgba(251,191,36,0.05);">
<h3>Sunrise Period</h3>
<p style="color: var(--muted); line-height: 1.6;">
<strong>{{ $name }}.lthn</strong> is reserved during the .lthn sunrise period. This name is protected to give the rightful brand owner the opportunity to claim their identity on the Lethean blockchain.
</p>
<p style="margin-top: 1rem; display: flex; gap: 0.75rem; flex-wrap: wrap;">
<a href="/sunrise" class="api-link">About the Sunrise Period &rarr;</a>
<a href="mailto:developers@lethean.io?subject=Sunrise%20Enquiry:%20{{ $name }}.lthn" class="api-link" style="background: var(--surface); border: 1px solid var(--border);">Enquire about this name</a>
</p>
</div>
@endif
<div style="margin-top: 2rem; display: flex; gap: 1.5rem;">
<a href="/names">&larr; Back to directory</a>
<a href="/v1/names/lookup/{{ $name }}">API lookup &rarr;</a>
</div>
</div>
@endsection