diff --git a/src/app/watch/components/search/Search.tsx b/src/app/watch/components/search/Search.tsx index fb5bd37..6516cba 100644 --- a/src/app/watch/components/search/Search.tsx +++ b/src/app/watch/components/search/Search.tsx @@ -6,7 +6,7 @@ import { IoClose } from 'react-icons/io5' import { useDebounce } from 'use-debounce' import { useEventListener } from 'usehooks-ts' -import WatchResource from '@/app/watch/watchResource' +import WatchResource from '@/app/watch/components/watchResource/watchResource' import Spinner from '@/components/spinner/Spinner' import { Input } from '@headlessui/react' diff --git a/src/app/watch/watchResource.tsx b/src/app/watch/components/watchResource/watchResource.tsx similarity index 99% rename from src/app/watch/watchResource.tsx rename to src/app/watch/components/watchResource/watchResource.tsx index 95654e3..ceb1e57 100644 --- a/src/app/watch/watchResource.tsx +++ b/src/app/watch/components/watchResource/watchResource.tsx @@ -11,7 +11,7 @@ import { tv } from 'tailwind-variants' import Badge from '@/components/badge/Badge' import Meteors from '@/components/cards/Meteors' -import type { WatchResource } from './types' +import type { WatchResource } from '../../types' const VariantMapping = { Article: { diff --git a/src/app/watch/watchResources.tsx b/src/app/watch/components/watchResource/watchResources.tsx similarity index 95% rename from src/app/watch/watchResources.tsx rename to src/app/watch/components/watchResource/watchResources.tsx index 5f059f1..01d6d89 100644 --- a/src/app/watch/watchResources.tsx +++ b/src/app/watch/components/watchResource/watchResources.tsx @@ -5,8 +5,12 @@ import { FC, useState } from 'react' import Spinner from '@/components/spinner/Spinner' import { fetchWatchPages } from '@/lib/notion' -import { transformWatchResourceToDTO } from './dto/watchResource.dto' -import { groupWatchResourcesByDate, groupWatchResourcesByMonth } from './utils' +import { transformWatchResourceToDTO } from '../../dto/watchResource.dto' +import { + groupWatchResourcesByDate, + groupWatchResourcesByMonth, +} from '../../utils' + import WatchResource from './watchResource' type Props = { diff --git a/src/app/watch/page.tsx b/src/app/watch/page.tsx index 6ebecee..cd4d803 100644 --- a/src/app/watch/page.tsx +++ b/src/app/watch/page.tsx @@ -1,17 +1,15 @@ +import { Suspense } from 'react' + import ArrowIcon from '@/components/icons/ArrowIcon' -import { fetchWatchPages } from '@/lib/notion' +import Spinner from '@/components/spinner/Spinner' import IntroAlert from './components/introAlert/IntroAlert' import Search from './components/search/Search' -import { transformWatchResourceToDTO } from './dto/watchResource.dto' -import WatchResources from './watchResources' +import WatchResourcesList from './watchResourcesList' export const revalidate = 3600 export default async function Page() { - const firstPage = await fetchWatchPages() - const initialResources = firstPage.results.map(transformWatchResourceToDTO) - return (