atproto explorer

fix queryLabels nonsense idk anymore

+21 -12
+21 -12
src/views/labels.tsx
··· 35 35 36 36 const [response, { refetch }] = createResource(uriPatterns, fetchLabels); 37 37 38 + const queryLabels = async () => { 39 + setLabels([]); 40 + setUriPatterns( 41 + (document.getElementById("patterns") as HTMLInputElement).value, 42 + ); 43 + }; 44 + 38 45 return ( 39 46 <> 40 47 <div class="z-5 dark:bg-dark-700 sticky top-0 flex w-full flex-col items-center justify-center gap-2 bg-slate-100 py-4"> ··· 56 63 cols={25} 57 64 class="dark:bg-dark-100 rounded-lg border border-gray-400 px-2 py-1 focus:outline-none focus:ring-1 focus:ring-gray-300" 58 65 /> 59 - <button 60 - onclick={() => 61 - setUriPatterns( 62 - (document.getElementById("patterns") as HTMLInputElement) 63 - .value, 64 - ) 65 - } 66 - type="submit" 67 - class="dark:bg-dark-700 dark:hover:bg-dark-800 rounded-lg border border-gray-400 bg-white px-2.5 py-1.5 text-sm font-bold hover:bg-gray-100 focus:outline-none focus:ring-1 focus:ring-gray-300" 68 - > 69 - Get 70 - </button> 66 + <div class="flex min-w-[3rem] justify-center"> 67 + <Show when={!response.loading}> 68 + <button 69 + onclick={() => queryLabels()} 70 + type="submit" 71 + class="dark:bg-dark-700 dark:hover:bg-dark-800 rounded-lg border border-gray-400 bg-white px-2.5 py-1.5 text-sm font-bold hover:bg-gray-100 focus:outline-none focus:ring-1 focus:ring-gray-300" 72 + > 73 + Get 74 + </button> 75 + </Show> 76 + <Show when={response.loading}> 77 + <div class="i-line-md-loading-twotone-loop text-xl"></div> 78 + </Show> 79 + </div> 71 80 </div> 72 81 </form> 73 82 <div class="flex items-center gap-x-2">