choose.js (1160B)
1 import { useRouter } from "next/router"; 2 3 import CommonHead from "../../components/CommonHead.js"; 4 import Footer from "../../components/Footer.js"; 5 import Header from "../../components/Header.js"; 6 import HeadTitle from "../../components/HeadTitle.js"; 7 import UnorderedList from "../../components/UnorderedList.js"; 8 9 import { site } from "../../config.js"; 10 11 function Tags() { 12 const router = useRouter(); 13 const { chooseQuotes } = require("../../helperFns.js"); 14 15 if (router.isReady) { 16 const quotes = chooseQuotes(router); 17 return ( 18 <div className="site"> 19 <CommonHead /> 20 <HeadTitle title="Filtered quotes" ogtitle="Filtered quotes" /> 21 <Header pageTitle={`${site.title} (${quotes.length})`} /> 22 <main id="main" className="main"> 23 <div className="home-sections-container"> 24 <div className="home-sections"> 25 <section id="recent-posts" className="home-section"> 26 <UnorderedList arr={quotes} /> 27 </section> 28 </div> 29 </div> 30 </main> 31 <Footer /> 32 </div> 33 ); 34 } 35 return <div>Loading...</div>; 36 } 37 38 export default Tags;