New design

This commit is contained in:
2025-12-20 17:44:35 +01:00
parent c693f7c7ed
commit bc25bb1626
12 changed files with 826 additions and 299 deletions

View File

@@ -4,7 +4,7 @@ namespace App\Livewire\Person;
use Livewire\Component;
use App\Services\RiksdagenService;
use App\Enums\PartyEnum;
use App\Enums\Parties;
class Search extends Component
{
@@ -16,7 +16,7 @@ class Search extends Component
public function mount()
{
$this->parties = PartyEnum::cases();
$this->parties = collect(Parties::cases())->sortBy(fn($party) => $party->label())->toArray();
}
public function search()

View File

@@ -6,7 +6,9 @@ use Livewire\Component;
use App\Services\RiksdagenService;
use Livewire\Attributes\Computed;
use Asantibanez\LivewireCharts\Models\PieChartModel;
use Livewire\Attributes\Lazy;
#[Lazy()]
class Show extends Component
{
public $personId;
@@ -132,8 +134,9 @@ class Show extends Component
$statistics = $this->votingStatistics;
$pieChart = (new PieChartModel())
->setTitle('Röststatistik för ' . $this->selectedYear)
->setAnimated(true);
->setTitle('Voteringsstatistik för ' . $this->selectedYear)
->setAnimated(true)
->withDataLabels();
$colors = [
'Ja' => '#10b981', // Green
@@ -150,6 +153,11 @@ class Show extends Component
return $pieChart;
}
public function placeholder()
{
return view('livewire.person.show-skeleton');
}
public function render()
{
return view('livewire.person.show');