fix: search and status filter work together consistently
- Status filter chips stay visible during text search - Search results filtered by selected status (search + filter = AND) - Shows "Нет записей по фильтру" when search has results but filter excludes all
This commit is contained in:
@@ -792,12 +792,15 @@ function BookingsPageInner() {
|
||||
</div>
|
||||
|
||||
{searchResults ? (
|
||||
/* #5: Actionable search results */
|
||||
/* #5: Actionable search results — filtered by status */
|
||||
(() => {
|
||||
const filtered = statusFilter === "all" ? searchResults : searchResults.filter((r) => r.status === statusFilter);
|
||||
return (
|
||||
<div className="mt-4 space-y-2">
|
||||
{searchResults.length === 0 ? (
|
||||
<p className="text-sm text-neutral-500 py-8 text-center">Ничего не найдено</p>
|
||||
{filtered.length === 0 ? (
|
||||
<p className="text-sm text-neutral-500 py-8 text-center">{searchResults.length === 0 ? "Ничего не найдено" : "Нет записей по фильтру"}</p>
|
||||
) : (
|
||||
searchResults.map((r) => (
|
||||
filtered.map((r) => (
|
||||
<BookingCard key={`${r.type}-${r.id}`} status={r.status as BookingStatus}>
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="flex items-center gap-2 flex-wrap text-sm min-w-0">
|
||||
@@ -820,6 +823,8 @@ function BookingsPageInner() {
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})()
|
||||
) : (
|
||||
<>
|
||||
{/* Dashboard — what needs attention */}
|
||||
|
||||
Reference in New Issue
Block a user