diff --git a/src/components/DiscoverRoadmaps/DiscoverError.tsx b/src/components/DiscoverRoadmaps/DiscoverError.tsx new file mode 100644 index 000000000..a18012e13 --- /dev/null +++ b/src/components/DiscoverRoadmaps/DiscoverError.tsx @@ -0,0 +1,21 @@ +import { ErrorIcon } from '../ReactIcons/ErrorIcon'; + +type DiscoverErrorProps = { + message: string; +}; + +export function DiscoverError(props: DiscoverErrorProps) { + const { message } = props; + + return ( +
+ +

+ Oops! Something went wrong +

+

+ {message} +

+
+ ); +} diff --git a/src/pages/discover.astro b/src/pages/discover.astro index 19b94a1a8..dbfee1565 100644 --- a/src/pages/discover.astro +++ b/src/pages/discover.astro @@ -2,6 +2,7 @@ import { roadmapApi } from '../api/roadmap'; import BaseLayout from '../layouts/BaseLayout.astro'; import { DiscoverRoadmaps } from '../components/DiscoverRoadmaps/DiscoverRoadmaps'; +import { DiscoverError } from '../components/DiscoverRoadmaps/DiscoverError'; export const prerender = false; @@ -9,14 +10,11 @@ const roadmapApiClient = roadmapApi(Astro); const { error, response: roadmaps } = await roadmapApiClient.listShowcaseRoadmap(); -console.log('-'.repeat(20)); -console.log(error); -console.log('-'.repeat(20)); - const searchParams = Astro.url.searchParams.toString(); --- + {error && } { roadmaps && (