Skip to content

Commit 001a364

Browse files
committed
feat(search): add SearchLayout component and wrap SearchSongPage in Suspense for loading state
1 parent ab54e70 commit 001a364

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const dynamic = 'force-dynamic';
2+
export const revalidate = 0;
3+
4+
export default function SearchLayout({
5+
children,
6+
}: {
7+
children: React.ReactNode;
8+
}) {
9+
return <>{children}</>;
10+
}

apps/frontend/src/app/(content)/search/page.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1212
import Image from 'next/image';
1313
import Link from 'next/link';
1414
import { parseAsInteger, parseAsString, useQueryStates } from 'nuqs';
15-
import { useEffect, useMemo, useState } from 'react';
15+
import { Suspense, useEffect, useMemo, useState } from 'react';
1616
import Skeleton from 'react-loading-skeleton';
1717
import { create } from 'zustand';
1818

@@ -627,4 +627,12 @@ const SearchSongPage = () => {
627627
);
628628
};
629629

630-
export default SearchSongPage;
630+
const SearchPageWrapper = () => {
631+
return (
632+
<Suspense fallback={<div>Loading...</div>}>
633+
<SearchSongPage />
634+
</Suspense>
635+
);
636+
};
637+
638+
export default SearchPageWrapper;

0 commit comments

Comments
 (0)