From 5377a121b57a3c7edeb9cee318f4fd0dd4d67127 Mon Sep 17 00:00:00 2001 From: Manurbhav Arya Date: Fri, 28 Jun 2024 13:21:21 +0530 Subject: for json format props --- src/Accordion.astro | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Accordion.astro b/src/Accordion.astro index e222b05..aef911a 100644 --- a/src/Accordion.astro +++ b/src/Accordion.astro @@ -1,13 +1,14 @@ --- -// var accordionContent = await Astro.glob("../content/resourcesPage/*.md"); - + // for json interface IBody{ text: string; link?: string } +const {heading, body} = Astro.props as { heading: string; body: IBody[];}; + +// for markdown -// const {heading, body} = Astro.props as { heading: string; body: IBody[];}; -const {heading, Content} = Astro.props; +// const {heading, Content} = Astro.props; ---
@@ -19,18 +20,17 @@ const {heading, Content} = Astro.props;
{ - - // body.map((item, index) => { - // return( - // - // ) - // }) + body.map((item, index) => { + return( + + ) + }) }
-- cgit