@use('App\Models\Currency')
@livewire('manage-transaction-form', [ 'portfolio' => $portfolio, ]) @livewire('manage-portfolio-form', [ 'portfolio' => $portfolio, 'hideCancel' => true ]) @if($portfolio->wishlist) @endif @if(auth()->user()->id !== $portfolio->owner_id) @endif @can('fullAccess', $portfolio) @else @endcan @can('fullAccess', $portfolio)
@endcan
@livewire('portfolio-performance-chart', [ 'name' => 'portfolio-'.$portfolio->id, 'portfolio' => $portfolio ])
{{ Number::currency($metrics->get('total_market_gain_dollars', 0)) }}
{{ Number::currency($metrics->get('total_cost_basis', 0)) }}
{{ Number::currency($metrics->get('total_market_value', 0)) }}
{{ Number::currency($metrics->get('realized_gain_dollars', 0)) }}
{{ Number::currency($metrics->get('total_dividends_earned', 0)) }}
@if($portfolio->holdings->isEmpty())
{{ __('Nothing to show here yet') }}
@else @livewire('datatables.holdings-table', [ 'portfolio' => $portfolio ]) @endif
@if($portfolio->transactions->isEmpty())
{{ __('Nothing to show here yet') }}
@endif @livewire('transactions-list', [ 'portfolio' => $portfolio, 'transactions' => $portfolio->transactions ])
@if($portfolio->holdings->isEmpty())
{{ __('Nothing to show here yet') }}
@endif @livewire('top-performers-list', [ 'holdings' => $portfolio->holdings ])
{{-- @php $users = App\Models\User::take(3)->get(); @endphp @foreach($users as $user) @endforeach --}} @if(config('services.ai_chat_enabled')) @livewire('ui.ai-chat-window', [ 'chatable' => $portfolio, 'suggested_prompts' => [ [ 'text' => 'Which holding is most successful?', 'value' => 'Which holding is most successful in this portfolio?', ], [ 'text' => 'Should I diversify more?', 'value' => 'Is my portfolio diverse enough?', ] ], 'system_prompt' => " Most recent training data: " . now()->toDateString() . ". You are an investment portfolio assistant providing advice to an investor. Use the following information to provide relevant recommendations. Use the words 'likely' or 'may' in lieu of concrete statements (except for obvious statements of fact or common sense). Do not apologize. Be polite, but minimize gratuitous niceties. When referencing numbers, always round to the nearest 100th decimal place. The investor has the following holdings in this portfolio: {$formattedHoldings} Based on the current market data, quantity owned, and average cost basis, you can determine the performance of any holding. Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:" ]) @endif