2024-08-05 22:41:53 -05:00
< x - app - layout >
2024-08-05 22:45:34 -05:00
< 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-10-25 22:06:46 -05:00
< x - badge value = " { { __('Wishlist') }} " title = " { { __('Wishlist') }} " class = " badge-secondary mr-3 " />
@ endif
@ if ( auth () -> user () -> id !== $portfolio -> owner_id )
< x - badge value = " { { $portfolio->owner ->name }} " title = " { { __('Owner').': '. $portfolio->owner ->name }} " class = " badge-secondary badge-outline 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') }} "
2024-10-20 20:00:06 -05:00
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' , [
2024-08-23 21:59:42 -05:00
'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-08-23 21:59:42 -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 >
@ endif
2024-08-23 21:59:42 -05:00
@ 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
2024-08-23 21:59:42 -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
2024-08-23 21:59:42 -05:00
</ x - ib - card > -- }}
2024-08-22 22:45:17 -05:00
2024-10-31 17:33:48 -05:00
@ if ( config ( 'services.ai_chat_enabled' ))
2024-10-31 12:09:06 -05:00
@ livewire ( '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' => "
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' instead of concrete statements (except for obvious statements of fact or common sense):
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.
2024-10-31 15:19:59 -05:00
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: "
2024-10-31 12:09:06 -05:00
])
2024-10-31 17:33:48 -05:00
@ endif
2024-10-31 12:09:06 -05:00
2024-08-05 22:41:53 -05:00
</ div >
</ div >
</ x - app - layout >