From c11c5f8f85d1e77fb49a1d9f98fa401ce6648fd5 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 7 Jul 2024 18:44:00 +0200 Subject: [PATCH] add Analyst Insight Component --- src/lib/components/AnalystInsight.svelte | 228 ++++++++++++++++++++++ src/lib/store.ts | 2 +- src/routes/stocks/[tickerID]/+page.svelte | 10 +- 3 files changed, 238 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/AnalystInsight.svelte diff --git a/src/lib/components/AnalystInsight.svelte b/src/lib/components/AnalystInsight.svelte new file mode 100644 index 00000000..e5481e11 --- /dev/null +++ b/src/lib/components/AnalystInsight.svelte @@ -0,0 +1,228 @@ + + + + +
+
+ +
+ + +
+ + {#if data?.user?.tier === 'Pro'} + {#if isLoaded} + + {#if Object?.keys(rawData)?.length !== 0} + +
+
+ The AI model summarizes the latest Wallstreet Analyst Insight Report and extracts key points for you, focusing on what matters most. +
+
+ + + +
+ + + See All Ratings + + +
+
+ +
+ + + +
+ +
+
+ +
+ Last Report from {rawData.date} + {#if latestInfoDate(rawData.date)} + + {/if} +
+ +
+ + {rawData?.insight } + +
+ +
+
+
+ + +
+
+
+
+ + + + + + + {/if} + + {:else} +
+
+ +
+
+ {/if} + + {:else} +
+ + Unlock content with Pro Subscription +
+ {/if} + +
+
+ + + + + \ No newline at end of file diff --git a/src/lib/store.ts b/src/lib/store.ts index 03c0c128..68111974 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -78,7 +78,7 @@ export const borrowedShareComponent= writable((false)); export const impliedVolatilityComponent= writable((false)); export const optionsNetFlowComponent= writable((false)); export const governmentContractComponent= writable((false)); - +export const analystInsightComponent= writable((false)); diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 00fd5edf..64af3b40 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -3,7 +3,7 @@ import {AreaSeries, Chart, PriceLine, CandlestickSeries} from 'svelte-lightweight-charts'; import { TrackingModeExitMode } from 'lightweight-charts'; - import {getCache, setCache, governmentContractComponent, optionsNetFlowComponent, impliedVolatilityComponent, borrowedShareComponent, clinicalTrialComponent, optionComponent, failToDeliverComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; + import {getCache, setCache, analystInsightComponent, governmentContractComponent, optionsNetFlowComponent, impliedVolatilityComponent, borrowedShareComponent, clinicalTrialComponent, optionComponent, failToDeliverComponent, marketMakerComponent, analystEstimateComponent, sentimentComponent, screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, varComponent, shareStatisticsComponent, enterpriseComponent, darkPoolComponent, retailVolumeComponent, shareholderComponent, trendAnalysisComponent, revenueSegmentationComponent, priceAnalysisComponent, fundamentalAnalysisComponent, userRegion, isCrosshairMoveActive, realtimePrice, priceIncrease, currentPortfolioPrice, currentPrice, stockTicker, isOpen, isBeforeMarketOpen, isWeekend} from '$lib/store'; import { onDestroy, onMount } from 'svelte'; import BullBearSay from '$lib/components/BullBearSay.svelte'; import CommunitySentiment from '$lib/components/CommunitySentiment.svelte'; @@ -1244,6 +1244,14 @@ function changeChartType() { {/if} + +
+ {#await import('$lib/components/AnalystInsight.svelte') then {default: Comp}} + + {/await} +
+
+
{#await import('$lib/components/ClinicalTrial.svelte') then {default: Comp}}