{#if searchQuery?.length > 0} {/if}
{#each searchQuery?.length !== 0 ? testList : allRows as item}
{#if defaultRules?.includes(item?.rule)} {:else if ["Pro", "Plus"]?.includes(data?.user?.tier) || excludedRules?.has(item?.rule)} {:else} {item?.name} {/if}
{/each}
{#each stockList as item, index} {#each columns as column} {/each} {/each}
{#if item[column.key] === null || item[column.key] === undefined} n/a {:else if column.key === "symbol"} {:else if column.key === "name"} {#if item[column.key]?.length > charNumber} {item[column.key]?.slice(0, charNumber) + "..."} {:else} {item[column.key]} {/if} {:else if column?.type === "date"} {new Date(item[column.key]).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric", })} {:else if column?.type === "int"} {@html column.key === "marketCap" && item[column.key] === 0 ? "n/a" : abbreviateNumber(item[column.key], false, true)} {:else if column?.type === "decimal"} {item[column.key]?.toLocaleString("en-US")} {:else if column?.type === "decimalSign"} {#if item[column.key] >= 0} +{item[column.key]?.toLocaleString("en-US")} {:else if item[column.key] < 0} {item[column.key]?.toLocaleString("en-US")} {/if} {:else if column.key === "price"}
{#if item?.previous !== null && item?.previous !== undefined && Math.abs(item?.previous - item[column?.key]) >= 0.01} {/if} {item[column.key] !== null ? item[column.key]?.toFixed(2) : "n/a"}
{:else if column.type === "percent"} {item[column.key] > 0.01 ? item[column.key]?.toFixed(2) + "%" : "< 0.01%"} {:else if column.type === "percentSign"} {#if item[column.key] > 0} +{abbreviateNumber(item[column.key]?.toFixed(2))}% {:else if item[column.key] < 0} {abbreviateNumber(item[column.key]?.toFixed(2))}% {:else} {item[column.key]?.toFixed(2)}% {/if} {:else if column?.type === "rating"} {item[column.key]} {:else if column.type === "sentiment"}
= 55 ? "text-green-700 dark:text-[#00FC50]" : item[column.key] >= 50 ? "text-[#E57C34]" : "text-red-700 dark:text-[#FF2F1F]"} >
{item[column.key] >= 80 ? "Very Bullish" : item[column.key] >= 55 ? "Bullish" : item[column.key] > 50 ? "Mixed" : "Bearish"}
{item[column.key]}
{:else} {item[column.key]} {/if}