mirror of
https://github.com/supabase/supabase.git
synced 2026-05-31 18:03:33 +08:00
* improve admonition * remove redundant loader * copywriting * table empty states * improve integrations presentation * match integration styling * fix clipping and h-full container * revert test * improve status presentation * nicer status * card status improvements * comment clarification * prettier lint * fix testes * comment * Fix infinite loading behaviour * Clean u0p * Replace NoFilterResults with NoSearchResults --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { Button, cn } from 'ui'
|
|
|
|
export interface NoSearchResultsProps {
|
|
searchString?: string
|
|
withinTableCell?: boolean
|
|
onResetFilter?: () => void
|
|
className?: string
|
|
label?: string
|
|
description?: string
|
|
}
|
|
|
|
export const NoSearchResults = ({
|
|
searchString,
|
|
withinTableCell = false,
|
|
onResetFilter,
|
|
className,
|
|
label,
|
|
description,
|
|
}: NoSearchResultsProps) => {
|
|
return (
|
|
<div
|
|
className={cn(
|
|
'flex items-center justify-between',
|
|
!withinTableCell && 'bg-surface-100 px-4 md:px-6 py-4 rounded-md border border-default',
|
|
className
|
|
)}
|
|
>
|
|
<div className="text-sm flex flex-col gap-y-0.5">
|
|
<p className="text-foreground">{label ?? 'No results found'}</p>
|
|
<p className="text-foreground-lighter">
|
|
{description ?? `Your search for “${searchString}” did not return any results`}
|
|
</p>
|
|
</div>
|
|
{onResetFilter !== undefined && (
|
|
<Button type="default" onClick={() => onResetFilter()}>
|
|
Reset filter
|
|
</Button>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|