fix(tui): distinguish asynchronous UI states (#36759)
This commit is contained in:
parent
ea386fba1f
commit
26e27c7a7f
10 changed files with 219 additions and 116 deletions
|
|
@ -26,6 +26,7 @@ export interface DialogSelectProps<T> {
|
|||
placeholder?: string
|
||||
footer?: JSX.Element
|
||||
emptyView?: JSX.Element
|
||||
noMatchView?: JSX.Element
|
||||
options: DialogSelectOption<T>[]
|
||||
flat?: boolean
|
||||
ref?: (ref: DialogSelectRef<T>) => void
|
||||
|
|
@ -615,11 +616,22 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|||
<Show
|
||||
when={grouped().length > 0}
|
||||
fallback={
|
||||
props.emptyView ?? (
|
||||
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
|
||||
<text fg={theme.textMuted}>No results found</text>
|
||||
</box>
|
||||
)
|
||||
<Show
|
||||
when={props.renderFilter !== false && store.filter.length > 0}
|
||||
fallback={
|
||||
props.emptyView ?? (
|
||||
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
|
||||
<text fg={theme.textMuted}>No items available</text>
|
||||
</box>
|
||||
)
|
||||
}
|
||||
>
|
||||
{props.noMatchView ?? (
|
||||
<box paddingLeft={4} paddingRight={4} paddingTop={1}>
|
||||
<text fg={theme.textMuted}>No results found</text>
|
||||
</box>
|
||||
)}
|
||||
</Show>
|
||||
}
|
||||
>
|
||||
<scrollbox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue