handleKeyDown(state?.value)} >
(inputValue = "")} class="grow rounded-sm border border-gray-300 dark:border-gray-600 py-2 pl-9 text-[1rem] placeholder-gray-600 dark:placeholder-gray-400 focus:shadow-lg focus:outline-hidden focus:ring-0 tiny:pl-8 xs:pl-10 text-muted dark:text-white md:py-2 w-full bg-[#F9FAFB] dark:bg-secondary focus:bg-white dark:focus:bg-secondary" placeholder="Company or stock symbol..." aria-label="Company or stock symbol..." />
{#if isLoading} {:else if inputValue?.length > 0} {:else}
ctrl K
{/if}
{#if inputValue?.length > 0 && searchBarData?.length > 0}
Suggestions
{#each searchBarData as item} handleSearch(item?.symbol, item?.type)} >
{item?.symbol} {item?.name} {item?.type}
{/each} {:else if inputValue?.length === 0 || !showSuggestions}
{searchHistory?.length > 0 ? "Recent" : "Popular"}
{#each searchHistory?.length > 0 ? searchHistory : popularList as item} handleSearch(item?.symbol, item?.type)} >
{item?.symbol} {item?.name} {item?.type}
{/each} {:else} No results found {/if}
{#if isLoading} {:else if inputValue?.length > 0} {:else} / {/if}
{#if !showSuggestions}
{searchHistory?.length > 0 ? "Recent" : "Popular"}
{/if}
    {#if !showSuggestions} {#each searchHistory?.length > 0 ? searchHistory : popularList as item}
  • popularTicker(item?.symbol)} class="mb-2 {item?.symbol === focusedSuggestion ? 'cursor-pointer flex justify-start items-center p-2 bg-white dark:bg-primary rounded group' : 'cursor-pointer bg-white dark:bg-secondary sm:hover:bg-gray-300 dark:sm:hover:bg-primary rounded-md flex justify-start items-center p-2 group'} w-full" >
    {item?.symbol} {item?.name.length > 150 ? item?.name?.slice(0, 150) + "..." : item?.name}
    {item?.type}
  • {/each} {:else if showSuggestions && searchBarData?.length > 0}
    Suggestions
    {#each searchBarData as item}
  • searchBarTicker(item?.symbol)} class="mb-2 {item?.symbol === focusedSuggestion ? 'shake-ticker cursor-pointer flex justify-start items-center p-2 bg-whitedark:bg-primary rounded group' : 'cursor-pointer mb-2 bg-white dark:bg-secondary sm:hover:bg-primary rounded-md flex justify-start items-center p-2 group'}" >
    {item?.symbol} {item?.name?.length > 150 ? item?.name?.slice(0, 150) + "..." : item?.name}
    {item?.type}
  • {/each} {:else if showSuggestions && searchBarData?.length === 0}
  • {/if}