Files
supabase/apps/studio/components/ui/NoSearchResults.tsx
Danny White 73ece8a470 chore(studio): improve projects presentation (#41179)
* 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>
2025-12-12 20:35:43 +11:00

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>
)
}