From 425240e39bfdaf29086ab9357206cf6608ee4c93 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 26 Aug 2023 00:18:18 -0500 Subject: [PATCH] Add separate description prop for ErrorCard, lighten header line, fix typo --- src/components/common/ErrorCard.tsx | 18 +++++++++++++----- src/pages/index.tsx | 4 ++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/common/ErrorCard.tsx b/src/components/common/ErrorCard.tsx index f7ed687..891bc6b 100644 --- a/src/components/common/ErrorCard.tsx +++ b/src/components/common/ErrorCard.tsx @@ -2,20 +2,28 @@ import { FunctionComponent, ReactNode } from "react"; import { XCircleIcon } from "@heroicons/react/20/solid"; export type ErrorCardProps = { - title: string; + title: ReactNode; + description?: ReactNode; issues?: ReactNode[]; }; -const ErrorCard: FunctionComponent = ({ title, issues }) => { +const ErrorCard: FunctionComponent = ({ + title, + description, + issues, +}) => { return (
-
-

{title}

-
+
+

{title}

+ {description != undefined ? ( +
{description}
+ ) : null} +
{issues != undefined ? (
    {issues.map((issueText, index) => ( diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 66dfd1c..0142a41 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -52,8 +52,8 @@ const Index: NextPage = () => { /> {error != null ? ( ) : null} {response != null ? : null}