wip more dashboard widgets
This commit is contained in:
@@ -81,29 +81,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-6 grid md:grid-cols-7 gap-5">
|
||||
|
||||
<x-ib-card title="{{ __('Holdings') }}" class="md:col-span-4">
|
||||
|
||||
|
||||
@livewire('holdings-table', [
|
||||
'portfolio' => $portfolio
|
||||
])
|
||||
|
||||
</x-ib-card>
|
||||
|
||||
{{-- <x-ib-card title="{{ __('Top performers') }}" class="md:col-span-3">
|
||||
|
||||
@php
|
||||
$users = App\Models\User::take(3)->get();
|
||||
@endphp
|
||||
|
||||
@foreach($users as $user)
|
||||
<x-list-item no-separator :item="$user" avatar="profile_photo_url" link="/docs/installation" />
|
||||
@endforeach
|
||||
|
||||
</x-ib-card> --}}
|
||||
|
||||
{{-- <x-ib-card title="{{ __('Top headlines') }}" class="md:col-span-3">
|
||||
|
||||
@@ -125,6 +111,34 @@
|
||||
|
||||
</x-ib-card>
|
||||
|
||||
<x-ib-card title="{{ __('Top performers') }}" class="md:col-span-3">
|
||||
|
||||
@foreach($portfolio->holdings->sortBy('market_gain_percent')->where('quantity', '>', 0)->take(5) as $holding)
|
||||
<x-list-item no-separator :item="$holding">
|
||||
|
||||
@php
|
||||
$gainPercent = (($holding->market_data?->market_value - $holding->average_cost_basis) / $holding->average_cost_basis) * 100;
|
||||
@endphp
|
||||
|
||||
<x-slot:value class="flex items-center">
|
||||
|
||||
{{ $holding->symbol }}
|
||||
|
||||
<x-badge class="{{ $gainPercent > 0 ? 'badge-success' : 'badge-error' }} ml-2 badge-sm" >
|
||||
<x-slot:value>
|
||||
{{ Number::percentage($gainPercent) }}
|
||||
</x-slot:value>
|
||||
</x-badge>
|
||||
|
||||
</x-slot:value>
|
||||
<x-slot:sub-value>
|
||||
{{ $holding->market_data?->name }}
|
||||
</x-slot:sub-value>
|
||||
</x-list-item>
|
||||
@endforeach
|
||||
|
||||
</x-ib-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user