Skip to content

Commit

Permalink
[Widget Too Big] Should be if-else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
mishig25 committed Sep 22, 2023
1 parent 9f73af5 commit 18d857a
Showing 1 changed file with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,39 @@
>
instead.
</p>
{/if}
{#if isMaximized}
<button class="absolute top-6 right-12" on:click={onClickMaximizeBtn}>
<IconCross classNames="text-xl text-gray-500 hover:text-black" />
</button>
{/if}
<WidgetHeader {noTitle} pipeline={model.pipeline_tag}>
{#if !!inputGroups.length}
<div class="ml-auto flex gap-x-1">
<!-- Show samples selector when there are more than one sample -->
{#if inputGroups.length > 1}
<WidgetInputSamplesGroup
bind:selectedInputGroup
{:else}
{#if isMaximized}
<button class="absolute top-6 right-12" on:click={onClickMaximizeBtn}>
<IconCross classNames="text-xl text-gray-500 hover:text-black" />
</button>
{/if}
<WidgetHeader {noTitle} pipeline={model.pipeline_tag}>
{#if !!inputGroups.length}
<div class="ml-auto flex gap-x-1">
<!-- Show samples selector when there are more than one sample -->
{#if inputGroups.length > 1}
<WidgetInputSamplesGroup
bind:selectedInputGroup
{isLoading}
inputGroups={inputGroups.map(({ group }) => group)}
/>
{/if}
<WidgetInputSamples
classNames={!selectedInputSamples ? "opacity-50 pointer-events-none" : ""}
{isLoading}
inputGroups={inputGroups.map(({ group }) => group)}
inputSamples={selectedInputSamples?.inputSamples ?? []}
{applyInputSample}
{previewInputSample}
/>
{/if}
<WidgetInputSamples
classNames={!selectedInputSamples ? "opacity-50 pointer-events-none" : ""}
{isLoading}
inputSamples={selectedInputSamples?.inputSamples ?? []}
{applyInputSample}
{previewInputSample}
/>
</div>
</div>
{/if}
</WidgetHeader>
<slot name="top" />
<WidgetInfo {model} {computeTime} {error} {modelLoadInfo} />
{#if modelLoading.isLoading}
<WidgetModelLoading estimatedTime={modelLoading.estimatedTime} />
{/if}
</WidgetHeader>
<slot name="top" />
<WidgetInfo {model} {computeTime} {error} {modelLoadInfo} />
{#if modelLoading.isLoading}
<WidgetModelLoading estimatedTime={modelLoading.estimatedTime} />
<slot name="bottom" />
<WidgetFooter {onClickMaximizeBtn} {outputJson} />
{/if}
<slot name="bottom" />
<WidgetFooter {onClickMaximizeBtn} {outputJson} />
</div>

0 comments on commit 18d857a

Please sign in to comment.