Phase 1 step 3 — make NotificationsPublisher available via DI and introduce the NOTIFICATIONS_ASYNC_ENABLED flag that will gate the listener cutover. - NotificationsAsyncConfig: tiny injectable that reads NOTIFICATIONS_ASYNC_ENABLED (truthy: 1/true/yes/on, default disabled). Callers don't touch process.env directly; per-category rollout can be added later without churn in listeners. - NotificationsModule providers/exports now include NotificationsPublisher and NotificationsAsyncConfig so listeners/handlers can inject them. - Tests (14 specs on the flag + 4 on the publisher = 18 total green): * default disabled when unset * truthy parsing (1, true, TRUE, yes, on, padded) * falsy parsing (false, 0, no, off, empty, unknown) * describe() reports human-readable state No call sites updated yet — next commit migrates the first listener (PaymentCompletedListener pilot) onto the publisher with the flag check. Co-Authored-By: Paperclip <noreply@paperclip.ing>
73 lines
3.1 KiB
TypeScript
73 lines
3.1 KiB
TypeScript
export default function SearchLoading() {
|
|
return (
|
|
<div className="mx-auto max-w-7xl px-4 py-6" aria-busy="true" aria-label="Đang tải kết quả tìm kiếm">
|
|
{/* Header skeleton */}
|
|
<div className="mb-6">
|
|
<div className="h-8 w-64 animate-pulse rounded bg-muted" />
|
|
<div className="mt-2 h-4 w-80 animate-pulse rounded bg-muted" />
|
|
</div>
|
|
|
|
{/* View mode toggle skeleton */}
|
|
<div className="mb-4 flex items-center justify-between">
|
|
<div className="flex gap-1 rounded-lg border p-1">
|
|
<div className="h-8 w-24 animate-pulse rounded bg-muted" />
|
|
<div className="h-8 w-24 animate-pulse rounded bg-muted" />
|
|
<div className="hidden h-8 w-24 animate-pulse rounded bg-muted lg:block" />
|
|
</div>
|
|
<div className="h-8 w-20 animate-pulse rounded bg-muted lg:hidden" />
|
|
</div>
|
|
|
|
{/* Filter bar skeleton (desktop) */}
|
|
<div className="mb-4 hidden lg:block">
|
|
<div className="flex gap-3 rounded-lg border p-4">
|
|
{Array.from({ length: 5 }).map((_, i) => (
|
|
<div key={i} className="h-9 w-36 animate-pulse rounded bg-muted" />
|
|
))}
|
|
<div className="h-9 w-24 animate-pulse rounded-md bg-muted" />
|
|
</div>
|
|
</div>
|
|
|
|
{/* Content area skeleton */}
|
|
<div className="flex gap-6">
|
|
{/* Sidebar skeleton (desktop) */}
|
|
<aside className="hidden w-64 shrink-0 lg:block">
|
|
<div className="rounded-lg border bg-card p-4">
|
|
<div className="space-y-4">
|
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
<div key={i}>
|
|
<div className="h-4 w-20 animate-pulse rounded bg-muted" />
|
|
<div className="mt-2 h-9 w-full animate-pulse rounded bg-muted" />
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
{/* Results grid skeleton */}
|
|
<div className="min-w-0 flex-1">
|
|
<div className="mb-4 flex items-center justify-between">
|
|
<div className="h-4 w-32 animate-pulse rounded bg-muted" />
|
|
<div className="h-9 w-40 animate-pulse rounded bg-muted" />
|
|
</div>
|
|
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
|
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
<div key={i} className="rounded-lg border bg-card shadow-sm">
|
|
<div className="aspect-[16/10] animate-pulse rounded-t-lg bg-muted" />
|
|
<div className="p-4">
|
|
<div className="h-5 w-3/4 animate-pulse rounded bg-muted" />
|
|
<div className="mt-2 h-4 w-1/2 animate-pulse rounded bg-muted" />
|
|
<div className="mt-3 flex gap-2">
|
|
<div className="h-6 w-16 animate-pulse rounded bg-muted" />
|
|
<div className="h-6 w-16 animate-pulse rounded bg-muted" />
|
|
</div>
|
|
<div className="mt-3 h-5 w-24 animate-pulse rounded bg-muted" />
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|