From 0f80683a96bdb9d7c49b446a5c12466a3004de29 Mon Sep 17 00:00:00 2001 From: Faraz Patankar Date: Sat, 4 Mar 2023 04:01:47 +0400 Subject: [PATCH] optional category --- src/layouts/templateLayout.tsx | 40 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/layouts/templateLayout.tsx b/src/layouts/templateLayout.tsx index a0661ed7f..919877f56 100644 --- a/src/layouts/templateLayout.tsx +++ b/src/layouts/templateLayout.tsx @@ -10,7 +10,7 @@ const templateLayoutConfig = z.object({ Description: z.string(), AuthorImage: z.string().nullish(), AuthorName: z.string(), - Category: z.string(), + Category: z.string().nullish(), }); type TemplateLayoutConfig = z.infer; @@ -69,25 +69,27 @@ const Component: React.FC<{ config: TemplateLayoutConfig }> = ({ config }) => {

{AuthorName}

)} -
- - - + {Category && ( +
+ + + -

{Category ?? "Other"}

-
+

{Category}

+
+ )}