quotes-nextjs

My favourite quotes. (nextjs)
git clone http://git.hanabi.in/repos/quotes-nextjs.git
Log | Files | Refs | LICENSE

QuoteBody.js (2089B)


      1 import Link from "next/link";
      2 import Head from "next/head";
      3 import React from "react";
      4 
      5 import Folder from "./Folder.js";
      6 import Attribution from "./Attribution.js";
      7 import Tag from "./Tag.js";
      8 
      9 function QuoteBody({
     10   HTMLStr,
     11   author,
     12   attributed,
     13   lang,
     14   misattributed,
     15   unverified,
     16   tags,
     17 }) {
     18   return (
     19     <>
     20       <Head>
     21         {tags.map((_) => (
     22           <meta property="article:tag" key={_} content={_} />
     23         ))}
     24       </Head>
     25       <main id="main" className="main">
     26         <article lang={lang} className="entry">
     27           <div
     28             className="entry-content"
     29             dangerouslySetInnerHTML={{ __html: HTMLStr }}
     30           />
     31           <footer className="entry-footer-container">
     32             <div className="entry-footer">
     33               <div className="categories">
     34                 <span className="taxonomyTerm-icon">
     35                   <Folder />
     36                 </span>
     37                 <span className="screen-reader">Author: </span>
     38                 <Link href={`/authors/${author}`}>
     39                   <a>{author}</a>
     40                 </Link>
     41                 <Attribution
     42                   attributed={attributed}
     43                   misattributed={misattributed}
     44                   unverified={unverified}
     45                 />
     46               </div>
     47               {tags.length ? (
     48                 <div className="tags">
     49                   <span className="taxonomyTerm-icon">
     50                     <Tag />
     51                   </span>
     52                   <span className="screen-reader">Tags: </span>
     53                   {tags.map((tag, index) => {
     54                     return (
     55                       <React.Fragment key={tag}>
     56                         <Link className="tag" href={`/tags/${tag}`}>
     57                           {tag}
     58                         </Link>
     59                         {index < tags.length - 1 ? ", " : ""}
     60                       </React.Fragment>
     61                     );
     62                   })}
     63                 </div>
     64               ) : null}
     65             </div>
     66           </footer>
     67         </article>
     68       </main>
     69     </>
     70   );
     71 }
     72 
     73 export default QuoteBody;