38 lines
1.8 KiB
PHP
38 lines
1.8 KiB
PHP
<div class="max-w-3xl mx-auto">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-t1">AI Insights</h1>
|
|
<p class="text-sm text-t3 mt-1">Analyze your link performance with AI</p>
|
|
</div>
|
|
<button wire:click="generate" wire:loading.attr="disabled" wire:target="generate"
|
|
class="px-4 py-2 bg-accent-gradient text-white rounded-lg text-sm font-medium hover:opacity-90 transition-opacity disabled:opacity-60 flex items-center gap-2">
|
|
<span wire:loading.remove wire:target="generate">
|
|
<x-heroicon-o-sparkles class="w-4 h-4 inline mr-1" />
|
|
Generate Insights
|
|
</span>
|
|
<span wire:loading wire:target="generate" class="flex items-center gap-2">
|
|
<svg class="animate-spin h-4 w-4" fill="none" viewBox="0 0 24 24">
|
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
|
|
</svg>
|
|
Analyzing…
|
|
</span>
|
|
</button>
|
|
</div>
|
|
|
|
@if($insights)
|
|
<div class="p-5 bg-s1 border border-white/[.06] rounded-xl">
|
|
<div class="flex items-center gap-2 mb-3 text-purple text-xs font-medium">
|
|
<x-heroicon-o-sparkles class="w-3.5 h-3.5" />
|
|
AI Analysis
|
|
</div>
|
|
<div class="text-sm text-t1 whitespace-pre-wrap leading-relaxed">{{ $insights }}</div>
|
|
</div>
|
|
@else
|
|
<div class="p-8 bg-s1 border border-white/[.06] rounded-xl text-center">
|
|
<x-heroicon-o-sparkles class="w-10 h-10 mx-auto text-t3 mb-3" />
|
|
<p class="text-sm text-t2">Click "Generate Insights" to analyze your top 10 links with AI.</p>
|
|
</div>
|
|
@endif
|
|
</div>
|