Files
investbrain/resources/views/portfolio/show.blade.php
T

154 lines
5.5 KiB
PHP
Raw Normal View History

2024-08-05 22:41:53 -05:00
<x-app-layout>
<div x-data>
2024-08-05 22:41:53 -05:00
2024-10-22 16:48:53 -05:00
<x-ib-alpine-modal
2024-10-18 14:59:10 -05:00
key="create-transaction"
2024-10-22 12:41:18 -05:00
title="{{ __('Create Transaction') }}"
2024-08-15 21:35:43 -05:00
>
@livewire('manage-transaction-form', [
'portfolio' => $portfolio,
])
2024-10-22 16:48:53 -05:00
</x-ib-alpine-modal>
2024-08-15 21:35:43 -05:00
2024-08-05 22:41:53 -05:00
<x-ib-drawer
key="manage-portfolio"
2024-10-22 12:41:18 -05:00
title="{{ __('Manage Portfolio') }}"
2024-08-05 22:41:53 -05:00
>
2024-08-06 20:41:52 -05:00
@livewire('manage-portfolio-form', [
'portfolio' => $portfolio,
'hideCancel' => true
])
2024-08-05 22:41:53 -05:00
</x-ib-drawer>
<x-ib-toolbar :title="$portfolio->title">
@if($portfolio->wishlist)
2024-08-15 21:35:43 -05:00
<x-badge value="{{ __('Wishlist') }}" class="badge-secondary mr-3" />
2024-08-05 22:41:53 -05:00
@endif
2024-10-21 22:23:20 -05:00
@can('fullAccess', $portfolio)
2024-08-05 22:41:53 -05:00
<x-button
2024-10-22 12:41:18 -05:00
title="{{ __('Manage Portfolio') }}"
2024-08-05 22:41:53 -05:00
icon="o-pencil"
class="btn-circle btn-ghost btn-sm text-secondary"
@click="$dispatch('toggle-manage-portfolio')"
/>
2024-10-21 22:23:20 -05:00
@endcan
2024-08-15 21:35:43 -05:00
<x-ib-flex-spacer />
2024-10-21 22:23:20 -05:00
@can('fullAccess', $portfolio)
2024-08-15 21:35:43 -05:00
<div>
<x-button
2024-10-22 12:41:18 -05:00
label="{{ __('Create Transaction') }}"
class="btn-sm btn-primary whitespace-nowrap"
2024-10-18 14:59:10 -05:00
@click="$dispatch('toggle-create-transaction')"
2024-08-15 21:35:43 -05:00
/>
</div>
2024-10-21 22:23:20 -05:00
@endcan
2024-08-05 22:41:53 -05:00
</x-ib-toolbar>
2024-08-15 21:35:43 -05:00
@livewire('portfolio-performance-chart', [
2024-08-06 22:59:17 -05:00
'name' => 'portfolio-'.$portfolio->id,
'portfolio' => $portfolio
])
2024-08-05 22:41:53 -05:00
2024-08-06 22:59:17 -05:00
<div class="grid sm:grid-cols-5 gap-5">
2024-08-05 22:41:53 -05:00
2024-08-21 20:42:32 -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">
2024-10-18 19:51:42 -05:00
<div class="text-sm text-gray-400 whitespace-nowrap truncate">{{ __('Market Gain/Loss') }}</div>
2024-08-21 20:42:32 -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>
2024-08-05 22:41:53 -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">
2024-10-18 19:51:42 -05:00
<div class="text-sm text-gray-400 whitespace-nowrap truncate">{{ __('Total Cost Basis') }}</div>
2024-08-21 20:42:32 -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">
2024-10-18 19:51:42 -05:00
<div class="text-sm text-gray-400 whitespace-nowrap truncate">{{ __('Total Market Value') }}</div>
2024-08-21 20:42:32 -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>
<x-card class="col-span-5 sm:col-span-1 bg-slate-100 dark:bg-base-200 rounded-lg">
2024-10-18 19:51:42 -05:00
<div class="text-sm text-gray-400 whitespace-nowrap truncate">{{ __('Realized Gain/Loss') }}</div>
2024-08-21 20:42:32 -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">
2024-10-18 19:51:42 -05:00
<div class="text-sm text-gray-400 whitespace-nowrap truncate">{{ __('Dividends Earned') }}</div>
2024-08-21 20:42:32 -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-05 22:41:53 -05:00
</div>
<div class="mt-6 grid md:grid-cols-7 gap-5">
2024-10-22 12:13:36 -05:00
<x-ib-card title="{{ __('Holdings') }}" class="md:col-span-4 overflow-scroll">
2024-08-17 21:33:09 -05:00
2024-09-06 23:15:43 -05:00
@if($portfolio->holdings->isEmpty())
<div class="flex justify-center items-center h-full pb-10 text-secondary">
{{ __('Nothing to show here yet') }}
</div>
@else
2024-08-05 22:41:53 -05:00
2024-09-06 23:15:43 -05:00
@livewire('holdings-table', [
'portfolio' => $portfolio
])
@endif
2024-08-05 22:41:53 -05:00
</x-ib-card>
2024-08-17 21:33:09 -05:00
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
2024-09-06 23:15:43 -05:00
@if($portfolio->transactions->isEmpty())
<div class="flex justify-center items-center h-full pb-10 text-secondary">
{{ __('Nothing to show here yet') }}
</div>
2024-08-05 22:41:53 -05:00
2024-09-06 23:15:43 -05:00
@endif
2024-08-15 21:35:43 -05:00
@livewire('transactions-list', [
'portfolio' => $portfolio,
'transactions' => $portfolio->transactions
2024-08-15 21:35:43 -05:00
])
2024-08-05 22:41:53 -05:00
</x-ib-card>
2024-08-22 22:45:17 -05:00
<x-ib-card title="{{ __('Top performers') }}" class="md:col-span-3">
2024-09-06 23:15:43 -05:00
@if($portfolio->holdings->isEmpty())
<div class="flex justify-center items-center h-full pb-10 text-secondary">
{{ __('Nothing to show here yet') }}
</div>
@endif
@livewire('top-performers-list', [
'holdings' => $portfolio->holdings
])
</x-ib-card>
{{-- <x-ib-card title="{{ __('Top headlines') }}" class="md:col-span-3">
@php
$users = App\Models\User::take(3)->get();
@endphp
2024-08-22 22:45:17 -05:00
@foreach($users as $user)
<x-list-item no-separator :item="$user" avatar="profile_photo_url" link="/docs/installation" />
2024-08-22 22:45:17 -05:00
@endforeach
</x-ib-card> --}}
2024-08-22 22:45:17 -05:00
2024-08-05 22:41:53 -05:00
</div>
</div>
</x-app-layout>