Files
investbrain/resources/views/dashboard.blade.php
T

98 lines
4.0 KiB
PHP
Raw Normal View History

2024-08-06 20:41:52 -05:00
<x-app-layout>
2024-08-15 21:35:43 -05:00
@livewire('portfolio-performance-chart', [
2024-08-06 22:59:17 -05:00
'name' => 'dashboard'
])
2024-08-06 20:41:52 -05:00
2024-08-06 22:59:17 -05:00
<div class="grid sm:grid-cols-5 gap-5">
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
<div class="text-sm text-gray-400 whitespace-nowrap">{{ __('Market Gain/Loss') }}</div>
2024-08-21 20:47:06 -05:00
<div class="font-black text-xl"> {{ Number::currency($metrics->total_gain_dollars) }} </div>
2024-08-06 22:59:17 -05:00
</x-card>
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
<div class="text-sm text-gray-400 whitespace-nowrap">{{ __('Total Cost Basis') }}</div>
2024-08-21 20:47:06 -05:00
<div class="font-black text-xl"> {{ Number::currency($metrics->total_cost_basis) }} </div>
2024-08-06 22:59:17 -05:00
</x-card>
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
<div class="text-sm text-gray-400 whitespace-nowrap">{{ __('Total Market Value') }}</div>
2024-08-21 20:47:06 -05:00
<div class="font-black text-xl"> {{ Number::currency($metrics->total_market_value) }} </div>
2024-08-06 22:59:17 -05:00
</x-card>
2024-08-06 20:41:52 -05:00
2024-08-06 22:59:17 -05:00
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
<div class="text-sm text-gray-400 whitespace-nowrap">{{ __('Realized Gain/Loss') }}</div>
2024-08-21 20:47:06 -05:00
<div class="font-black text-xl"> {{ Number::currency($metrics->realized_gain_dollars) }} </div>
2024-08-06 22:59:17 -05:00
</x-card>
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
<div class="text-sm text-gray-400 whitespace-nowrap">{{ __('Dividends Earned') }}</div>
2024-08-21 20:47:06 -05:00
<div class="font-black text-xl"> {{ Number::currency($metrics->total_dividends_earned) }} </div>
2024-08-06 22:59:17 -05:00
</x-card>
2024-08-06 20:41:52 -05:00
</div>
<div class="mt-6 grid md:grid-cols-7 gap-5">
2024-08-06 22:59:17 -05:00
<x-ib-card title="{{ __('My portfolios') }}" class="md:col-span-4">
2024-08-07 13:06:40 -05:00
@if ($user->portfolios->isEmpty())
2024-08-07 13:06:40 -05:00
<div class="flex justify-center items-center h-[100px] mb-8">
2024-08-30 20:22:28 -05:00
<x-button label="{{ __('Import / Export Data') }}" class="btn-primary btn-outline mr-6" link="{{ route('import-export') }}" />
<span>{{ __('or') }}</span>
<x-button label="{{ __('Create your first portfolio!') }}" class="btn-primary ml-6" link="{{ route('portfolio.create') }}" />
2024-08-07 13:06:40 -05:00
</div>
@endif
2024-08-06 20:41:52 -05:00
2024-08-06 22:59:17 -05:00
@foreach($user->portfolios as $portfolio)
<x-list-item :item="$portfolio" link="{{ route('portfolio.show', ['portfolio' => $portfolio->id]) }}">
2024-08-06 22:59:17 -05:00
<x-slot:value>
{{ $portfolio->title }}
@if($portfolio->wishlist)
2024-08-15 21:35:43 -05:00
<x-badge value="{{ __('Wishlist') }}" class="badge-secondary badge-sm ml-2" />
2024-08-06 22:59:17 -05:00
@endif
</x-slot:value>
</x-list-item>
2024-08-06 20:41:52 -05:00
@endforeach
</x-ib-card>
@if (!$user->portfolios->isEmpty())
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
@livewire('transactions-list', [
'transactions' => $user->transactions
])
2024-08-22 22:45:17 -05:00
</x-ib-card>
@endif
2024-08-22 22:45:17 -05:00
@if (!$user->portfolios->isEmpty())
<x-ib-card title="{{ __('Top performers') }}" class="md:col-span-3">
2024-08-22 22:45:17 -05:00
@livewire('top-performers-list', [
'holdings' => $user->holdings
])
2024-08-06 20:41:52 -05:00
</x-ib-card>
2024-08-07 13:06:40 -05:00
@endif
2024-08-22 22:45:17 -05:00
2024-08-15 21:35:43 -05:00
{{-- @if (!$user->portfolios->isEmpty())
2024-08-06 22:59:17 -05:00
<x-ib-card title="{{ __('Top headlines') }}" class="md:col-span-3">
2024-08-06 20:41:52 -05:00
@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>
2024-08-15 21:35:43 -05:00
@endif --}}
2024-08-06 20:41:52 -05:00
</div>
</x-app-layout>