This commit is contained in:
MuslemRahimi 2024-11-01 10:30:07 +01:00
parent 0bb2afb4a7
commit 87c0f355a2
2 changed files with 20 additions and 18 deletions

View File

@ -813,6 +813,7 @@ function handleTypeOfTrade(state:string)
/> />
</li> </li>
{/if} {/if}
{#if Object?.keys(data?.getAnalystRating ?? {})?.length > 0}
<li class="cursor-pointer flex flex-col items-center"> <li class="cursor-pointer flex flex-col items-center">
<a <a
href={`/stocks/${$stockTicker}/forecast`} href={`/stocks/${$stockTicker}/forecast`}
@ -830,6 +831,7 @@ function handleTypeOfTrade(state:string)
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]" : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]"
/> />
</li> </li>
{/if}
<li class="cursor-pointer flex flex-col items-center"> <li class="cursor-pointer flex flex-col items-center">
<a <a
href={`/stocks/${$stockTicker}/options`} href={`/stocks/${$stockTicker}/options`}

View File

@ -48,7 +48,7 @@
const highChange = calculatePriceChange(highPriceTarget); const highChange = calculatePriceChange(highPriceTarget);
const rawAnalystList = data?.getAnalystRating?.recommendationList || []; const rawAnalystList = data?.getAnalystRating?.recommendationList || [];
const recommendationList = const recommendationList =
rawAnalystList?.length > 5 ? rawAnalystList?.slice(-6, -1) : rawAnalystList; rawAnalystList?.length > 5 ? rawAnalystList?.slice(-6) : rawAnalystList;
const categories = ["Strong Buy", "Buy", "Hold", "Sell", "Strong Sell"]; const categories = ["Strong Buy", "Buy", "Hold", "Sell", "Strong Sell"];
function findIndex(data) { function findIndex(data) {