Files
old-kitabcitab-frontend/kitabcitab/.next/cache/webpack/client-development/3.pack

682 lines
61 KiB
Plaintext
Raw Normal View History

wpc<11><10>webpack/lib/cache/PackFileCacheStrategy<67>PackContentItems <10><1E> ResolverCachePlugin|normal|default|fallback=[|assert=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/assert/assert.js|buffer=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/buffer/index.js|constants=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/domain-browser/index.js|http=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/stream-http/index.js|https=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/https-browserify/index.js|os=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/punycode/punycode.js|process=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/build/polyfills/process.js|querystring=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/util/util.js|timers=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/util/util.js|vm=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/events/events.js|setImmediate=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|commonjs|path=|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab|request=|./pages/search.js<1E>Compilation/modules|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/@next/react-refresh-utils/dist/loader.js!/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use[1]!/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js<1E>Compilation/codeGeneration|/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/compiled/@next/react-refresh-utils/dist/loader.js!/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use[1]!/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js|webpack<10>webpack/lib/cache/ResolverCachePlugin<11><10>`<12>_ResolverCachePluginCacheMiss<73>context<78>path<74>request<73>query<72>fragment<6E>module<6C>directory<72>file<6C>internal<61>fullySpecified<65>descriptionFilePath<74>descriptionFileData<74>descriptionFileRoot<6F>relativePath<74>__innerReques
<15><15><>/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages<15><>/home/ismail/Desktop/KitabCitab/kitabcitab-frontend<6E>/home/ismail/Desktop/KitabCitab<61>/home/ismail/Desktop<6F>/home/ismail<69>/home<6D>/<03>safeTime<6D>accuracy<63>timestamp X?<3F>UxB
pW?<3F>UxB<15> `R<>*cxB R<>*cxB <15><15><15><15><15><15><15><01>/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/package.json <10>webpack/lib/NormalModule<11>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<1F>&import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
var _s = $RefreshSig$();
import React, { useState } from "react";
import Results from "../components/Results";
import { AiOutlineClose, AiOutlineSearch } from "react-icons/ai";
import Link from "next/link";
import { useRef } from "react";
import { useRouter } from "next/router";
const SearchPage = (param)=>{
let { data } = param;
_s();
const router = useRouter();
const [searchInput, setSearchInput] = useState(router.query.term);
const search = ()=>{
const term = searchInput;
if (!term) return;
router.push("/search?term=".concat(term));
};
console.log(data);
2023-01-04 02:30:44 +01:00
return /*#__PURE__*/ _jsxDEV("div", {
className: "flex flex-col justify-center",
children: [
/*#__PURE__*/ _jsxDEV("div", {
className: "flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]",
children: [
/*#__PURE__*/ _jsxDEV("div", {
className: "p-10 w-[100vw] laptop:w-[25rem]",
children: /*#__PURE__*/ _jsxDEV(Link, {
href: "/",
children: /*#__PURE__*/ _jsxDEV("p", {
className: "text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif ",
children: "KitabCitab"
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 32
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 17
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
columnNumber: 13
}, this),
/*#__PURE__*/ _jsxDEV("div", {
className: "group my-3 mx-auto py-5 h-[4vh] min-w-[90vw] bg-[#303134] border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl flex flex-row justify-around items-center tablet:w-[70vw] laptop:min-w-[40vw] laptop:w-[40vw] laptop:mx-0 laptop:my-10 laptop:justify-between ",
children: [
/*#__PURE__*/ _jsxDEV("i", {
className: "rounded-3xl hover:border-black text-[#9aa0a6] px-3",
onClick: ()=>search(),
children: /*#__PURE__*/ _jsxDEV(AiOutlineSearch, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 108
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("input", {
value: searchInput,
onChange: (e)=>setSearchInput(e.target.value),
className: "bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg "
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 48,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("i", {
className: "rounded-3xl text-[#9aa0a6] px-3",
onClick: ()=>setSearchInput(""),
children: /*#__PURE__*/ _jsxDEV(AiOutlineClose, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 99
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 17
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 28,
columnNumber: 13
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 9
}, this),
/*#__PURE__*/ _jsxDEV(Results, {
data: data.hits.hits
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 52,
columnNumber: 9
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 23,
2023-01-04 02:30:44 +01:00
columnNumber: 5
}, this);
};
_s(SearchPage, "IsLZJYvJOe/NK3tDne6YdoM8MeY=", false, function() {
return [
useRouter
];
});
_c = SearchPage;
export var __N_SSP = true;
export default SearchPage;
2023-01-04 02:30:44 +01:00
var _c;
$RefreshReg$(_c, "SearchPage");
2023-01-04 02:30:44 +01:00
;
// Wrapped in an IIFE to avoid polluting the global scope
;
(function () {
var _a, _b;
// Legacy CSS implementations will `eval` browser code in a Node.js context
// to extract CSS. For backwards compatibility, we need to check we're in a
// browser context before continuing.
if (typeof self !== 'undefined' &&
// AMP / No-JS mode does not inject these helpers:
'$RefreshHelpers$' in self) {
// @ts-ignore __webpack_module__ is global
var currentExports = __webpack_module__.exports;
// @ts-ignore __webpack_module__ is global
var prevExports = (_b = (_a = __webpack_module__.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
// This cannot happen in MainTemplate because the exports mismatch between
// templating and execution.
self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, __webpack_module__.id);
// A module can be accepted automatically based on its exports, e.g. when
// it is a Refresh Boundary.
if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
// Save the previous exports on update so we can compare the boundary
// signatures.
__webpack_module__.hot.dispose(function (data) {
data.prevExports = currentExports;
});
// Unconditionally accept an update to this module, we'll check if it's
// still a Refresh Boundary later.
// @ts-ignore importMeta is replaced in the loader
import.meta.webpackHot.accept();
// This field is set when the previous version of this module was a
// Refresh Boundary, letting us know we need to check for invalidation or
// enqueue an update.
if (prevExports !== null) {
// A boundary can become ineligible if its exports are incompatible
// with the previous exports.
//
// For example, if you add/remove/change exports, we'll want to
// re-execute the importing modules, and force those components to
// re-render. Similarly, if you convert a class component to a
// function, we want to invalidate the boundary.
if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
__webpack_module__.hot.invalidate();
}
else {
self.$RefreshHelpers$.scheduleUpdate();
}
}
}
else {
// Since we just executed the code for the module, it's possible that the
// new exports made it ineligible for being a boundary.
// We only care about the case when we were _previously_ a boundary,
// because we already accepted this update (accidental side effect).
var isNoLongerABoundary = prevExports !== null;
if (isNoLongerABoundary) {
__webpack_module__.hot.invalidate();
}
}
}
})();
<1E>webpack://./node_modules/next/dist/compiled/@next/react-refresh-utils/dist/loader.js!./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use[1]!./pages/search.js{"version":3,"sources":["webpack://./pages/search.js"],"sourcesContent":["import React, { useState } from 'react'\nimport Results from '../components/Results'\nimport { AiOutlineClose, AiOutlineSearch } from 'react-icons/ai'\nimport Link from 'next/link'\nimport { useRef } from 'react'\nimport { useRouter } from 'next/router'\nimport { ENV_VAR } from '../envconfig'\n\n\nconst SearchPage = ({data}) => {\n const router = useRouter()\n const [searchInput, setSearchInput] = useState(router.query.term)\n\n const search = () => {\n const term = searchInput\n if(!term) return\n router.push(`/search?term=${term}`)\n }\n\n console.log(data)\n\n return (\n <div className='flex flex-col justify-center'>\n <div className=\"flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]\">\n <div className=\"p-10 w-[100vw] laptop:w-[25rem]\">\n <Link href='/'><p className=\"text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif \">KitabCitab</p></Link>\n </div>\n <div className=\"group\n my-3\n mx-auto\n py-5\n h-[4vh]\n min-w-[90vw]\n bg-[#303134]\n border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl \n flex flex-row justify-around items-center\n\n tablet:w-[70vw]\n\n laptop:min-w-[40vw]\n laptop:w-[40vw]\n laptop:mx-0\n laptop:my-10\n laptop:justify-between\n \"\n >\n <i className='rounded-3xl hover:border-black text-[#9aa0a6] px-3' onClick={() => search()}><AiOutlineSearch size={25}/></i>\n <input value={searchInput} onChange={(e) => setSearchInput(e.target.value)} className=\"bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg \"/>\n <i className='rounded-3xl text-[#9aa0a6] px-3' onClick={() => setSearchInput(\"\")}><AiOutlineClose size={25} /></i>\n </div>\n </div>\n <Results data={data.hits.hits}/>\n </div>\n )\n}\n\nexport async function getServerSideProps(context) {\n // Fetch data from external API\n const res = await fetch(`${ENV_VAR}_search?q=${context.query.term}`)\n const data = await res.json()\n \n // Pass data to the page via props\n return { props: { data } }\n }\n\nexport default SearchPage"],"names":["React","useState","Results","AiOutlineClose","AiOutlineSearch","Link","useRef","useRouter","SearchPage","data","router","searchInput","setSearchInput","query","term","search","push","console","log","div","className","href","p","i","onClick","size","input","value","onChange","e","target","hits"],"mappings":"AAAA;;AAAA,OAAOA,SAASC,QAAQ,QAAQ,QAAO;AACvC,OAAOC,aAAa,wBAAuB;AAC3C,SAASC,cAAc,EAAEC,eAAe,QAAQ,iBAAgB;AAChE,OAAOC,UAAU,YAAW;AAC5B,SAASC,MAAM,QAAQ,QAAO;AAC9B,SAASC,SAAS,QAAQ,cAAa;AAIvC,MAAMC,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH;IACf,MAAM,CAACI,aAAaC,eAAe,GAAGX,SAASS,OAAOG,KAAK,CAACC,IAAI;IAEhE,MAAMC,SAAS,IAAM;QACnB,MAAMD,OAAOH;QACb,IAAG,CAACG,MAAM;QACVJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IAC9B;IAEAG,QAAQC,GAAG,CAACT;IAEZ,qBACE,QAACU;QAAIC,WAAU;;0BACX,QAACD;gBAAIC,WAAU;;kCACX,QAACD;wBAAIC,WAAU;kCACX,cAAA,QAACf;4BAAKgB,MAAK;sCAAI,cAAA,QAACC;gCAAEF,WAAU;0CAA8E;;;;;;;;;;;;;;;;kCAE9G,QAACD;wBAAIC,WAAU;;0CAmBX,QAACG;gCAAEH,WAAU;gCAAqDI,SAAS,IAAMT;0CAAU,cAAA,QAACX;oCAAgBqB,MAAM;;;;;;;;;;;0CAClH,QAACC;gCAAMC,OAAOhB;gCAAaiB,UAAU,CAACC,IAAMjB,eAAeiB,EAAEC,MAAM,CAACH,KAAK;gCAAGP,WAAU;;;;;;0CACtF,QAACG;gCAAEH,WAAU;gCAAkCI,SAAS,IAAMZ,eAAe;0CAAK,cAAA,QAACT;oCAAesB,MAAM;;;;;;;;;;;;;;;;;;;;;;;0BAGhH,QAACvB;gBAASO,MAAMA,KAAKsB,IAAI,CAACA,IAAI;;;;;;;;;;;;AAGtC;GA7CMvB;;QACWD;;;KADXC;;AAwDN,eAAeA,WAAU","file":"x"}<05>expor
) `<01>A*R `(<10>webpack/lib/dependencies/HarmonyExportHeaderDependency A 3 A3 czz<02>undefined A<><00> c%%#<15> A
 c**<15> A   c//<15> A& *  c<#<'<15> AX\ cAA#<15> A<><00> cJJ#<15> ATX cT#T'<15> A<><00> cYY#<15> A<><00> c__<15> A<><00> cee<15> A<><00> cll<15> A<><00> crr  ACM A4N c{{&<26><><EFBFBD> A<><00>%<25><><EFBFBD> @<40>`!@<40>`3#<23><><EFBFBD> A%7"<22><><EFBFBD> @<40>`*@<40>`<<02>module.id Ao<00><15> @<40>`Q@<40>`f<1C><><EFBFBD> A<><00><1B><><EFBFBD> @<40>`@<40>`"<02>module.hot.accept A5 R <17><><EFBFBD> @<40>`@<40>`/<15><><EFBFBD> A<>#<00>#<14><><EFBFBD> @<40>`@<40>`*<12><><EFBFBD> Ao&<00>&<11><><EFBFBD> @<40>`@<40>`& `<10>webpack/lib/dependencies/HarmonyImportSideEffectDependency<18>react/jsx-dev-runtime<15> `:8<><38><EFBFBD>8<><38><EFBFBD> `(<18>../components/Results<15> `,<18>react-icons/ai<15> `A<18>next/link<15> `1<><31><EFBFBD>1<><31><EFBFBD> `<18>next/router<15> `(<10>webpack/lib/dependencies/HarmonyImportSpecifierDependencya <01>useRouter<15> A<><00> <15><15><15> c   <01>useState<15> A<><00> '<27><><EFBFBD>'<27><><EFBFBD><15> c * 2 <01>jsxDEV<17>_jsxDEV A<><00> <15><15><15> c  <15><15> A/6 <15><15><15> c! <15><15> A <15><15><15> c") <15><15> A<><00> <15><15><15> c07 <01>default<17>Link A<><00>  <15><15><15> c8< <15><15> A <15><15><15> c4; <15><15> A= D  <15><15><15> c0"0) <15><15> A<>
<00>
 <15><15><15> c3*31 <15><15> A<> <00>  <15><15><15> c686? <01>AiOutlineSearch<15> A<> <00>   <15><15><15> c6@6O <15><15> A<><00> <15><15><15> cB*B1 <15><15> A<><00> <15><15><15> cK*K1 <15><15> A<><00> <15><15><15> cN8N? <01>AiOutlineClose<15> A<><00>  <15><15><15> cN@NN <15><15> A<><00> <15><15><15> cff! <15><17>Results A<><00>  <15><15><15> cf"f) <15><15> A<><00>  <15><15><15> cvv<10>webpack/lib/dependencies/HarmonyExportSpecifierDependency@g<><67><EFBFBD>g<><67><EFBFBD> czz<10>webpack/lib/dependencies/HarmonyExportExpressionDependency`<60><15><> c{{  <04>sources<65>runtimeRequirements<74>dataJ<><4A><EFBFBD><01>javascript<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/CachedSource <00>B<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ConcatSource<10><10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/RawSource<1F>__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "__N_SSP": function() { return /* binding */ __N_SSP; }
/* harmony export */ });
2023-01-04 02:30:44 +01:00
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Results__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/Results */ "./components/Results.js");
/* harmony import */ var react_icons_ai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-icons/ai */ "./node_modules/react-icons/ai/index.esm.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/link */ "./node_modules/next/link.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! next/router */ "./node_modules/next/router.js");
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_4__);
<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/ReplaceSource<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/SourceMapSource<1F>&import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
var _s = $RefreshSig$();
import React, { useState } from "react";
import Results from "../components/Results";
import { AiOutlineClose, AiOutlineSearch } from "react-icons/ai";
import Link from "next/link";
import { useRef } from "react";
import { useRouter } from "next/router";
const SearchPage = (param)=>{
let { data } = param;
_s();
const router = useRouter();
const [searchInput, setSearchInput] = useState(router.query.term);
const search = ()=>{
const term = searchInput;
if (!term) return;
router.push("/search?term=".concat(term));
};
console.log(data);
2023-01-04 02:30:44 +01:00
return /*#__PURE__*/ _jsxDEV("div", {
className: "flex flex-col justify-center",
children: [
/*#__PURE__*/ _jsxDEV("div", {
className: "flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]",
children: [
/*#__PURE__*/ _jsxDEV("div", {
className: "p-10 w-[100vw] laptop:w-[25rem]",
children: /*#__PURE__*/ _jsxDEV(Link, {
href: "/",
children: /*#__PURE__*/ _jsxDEV("p", {
className: "text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif ",
children: "KitabCitab"
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 32
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 17
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
columnNumber: 13
}, this),
/*#__PURE__*/ _jsxDEV("div", {
className: "group my-3 mx-auto py-5 h-[4vh] min-w-[90vw] bg-[#303134] border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl flex flex-row justify-around items-center tablet:w-[70vw] laptop:min-w-[40vw] laptop:w-[40vw] laptop:mx-0 laptop:my-10 laptop:justify-between ",
children: [
/*#__PURE__*/ _jsxDEV("i", {
className: "rounded-3xl hover:border-black text-[#9aa0a6] px-3",
onClick: ()=>search(),
children: /*#__PURE__*/ _jsxDEV(AiOutlineSearch, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 108
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("input", {
value: searchInput,
onChange: (e)=>setSearchInput(e.target.value),
className: "bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg "
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 48,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("i", {
className: "rounded-3xl text-[#9aa0a6] px-3",
onClick: ()=>setSearchInput(""),
children: /*#__PURE__*/ _jsxDEV(AiOutlineClose, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 99
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 17
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 28,
columnNumber: 13
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 9
}, this),
/*#__PURE__*/ _jsxDEV(Results, {
data: data.hits.hits
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 52,
columnNumber: 9
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 23,
2023-01-04 02:30:44 +01:00
columnNumber: 5
}, this);
};
_s(SearchPage, "IsLZJYvJOe/NK3tDne6YdoM8MeY=", false, function() {
return [
useRouter
];
});
_c = SearchPage;
export var __N_SSP = true;
export default SearchPage;
2023-01-04 02:30:44 +01:00
var _c;
$RefreshReg$(_c, "SearchPage");
2023-01-04 02:30:44 +01:00
;
// Wrapped in an IIFE to avoid polluting the global scope
;
(function () {
var _a, _b;
// Legacy CSS implementations will `eval` browser code in a Node.js context
// to extract CSS. For backwards compatibility, we need to check we're in a
// browser context before continuing.
if (typeof self !== 'undefined' &&
// AMP / No-JS mode does not inject these helpers:
'$RefreshHelpers$' in self) {
// @ts-ignore __webpack_module__ is global
var currentExports = __webpack_module__.exports;
// @ts-ignore __webpack_module__ is global
var prevExports = (_b = (_a = __webpack_module__.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
// This cannot happen in MainTemplate because the exports mismatch between
// templating and execution.
self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, __webpack_module__.id);
// A module can be accepted automatically based on its exports, e.g. when
// it is a Refresh Boundary.
if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
// Save the previous exports on update so we can compare the boundary
// signatures.
__webpack_module__.hot.dispose(function (data) {
data.prevExports = currentExports;
});
// Unconditionally accept an update to this module, we'll check if it's
// still a Refresh Boundary later.
// @ts-ignore importMeta is replaced in the loader
import.meta.webpackHot.accept();
// This field is set when the previous version of this module was a
// Refresh Boundary, letting us know we need to check for invalidation or
// enqueue an update.
if (prevExports !== null) {
// A boundary can become ineligible if its exports are incompatible
// with the previous exports.
//
// For example, if you add/remove/change exports, we'll want to
// re-execute the importing modules, and force those components to
// re-render. Similarly, if you convert a class component to a
// function, we want to invalidate the boundary.
if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
__webpack_module__.hot.invalidate();
}
else {
self.$RefreshHelpers$.scheduleUpdate();
}
}
}
else {
// Since we just executed the code for the module, it's possible that the
// new exports made it ineligible for being a boundary.
// We only care about the case when we were _previously_ a boundary,
// because we already accepted this update (accidental side effect).
var isNoLongerABoundary = prevExports !== null;
if (isNoLongerABoundary) {
__webpack_module__.hot.invalidate();
}
}
}
})();
<1E>webpack://./node_modules/next/dist/compiled/@next/react-refresh-utils/dist/loader.js!./node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[3].oneOf[2].use[1]!./pages/search.js{"version":3,"sources":["webpack://./pages/search.js"],"sourcesContent":["import React, { useState } from 'react'\nimport Results from '../components/Results'\nimport { AiOutlineClose, AiOutlineSearch } from 'react-icons/ai'\nimport Link from 'next/link'\nimport { useRef } from 'react'\nimport { useRouter } from 'next/router'\nimport { ENV_VAR } from '../envconfig'\n\n\nconst SearchPage = ({data}) => {\n const router = useRouter()\n const [searchInput, setSearchInput] = useState(router.query.term)\n\n const search = () => {\n const term = searchInput\n if(!term) return\n router.push(`/search?term=${term}`)\n }\n\n console.log(data)\n\n return (\n <div className='flex flex-col justify-center'>\n <div className=\"flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]\">\n <div className=\"p-10 w-[100vw] laptop:w-[25rem]\">\n <Link href='/'><p className=\"text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif \">KitabCitab</p></Link>\n </div>\n <div className=\"group\n my-3\n mx-auto\n py-5\n h-[4vh]\n min-w-[90vw]\n bg-[#303134]\n border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl \n flex flex-row justify-around items-center\n\n tablet:w-[70vw]\n\n laptop:min-w-[40vw]\n laptop:w-[40vw]\n laptop:mx-0\n laptop:my-10\n laptop:justify-between\n \"\n >\n <i className='rounded-3xl hover:border-black text-[#9aa0a6] px-3' onClick={() => search()}><AiOutlineSearch size={25}/></i>\n <input value={searchInput} onChange={(e) => setSearchInput(e.target.value)} className=\"bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg \"/>\n <i className='rounded-3xl text-[#9aa0a6] px-3' onClick={() => setSearchInput(\"\")}><AiOutlineClose size={25} /></i>\n </div>\n </div>\n <Results data={data.hits.hits}/>\n </div>\n )\n}\n\nexport async function getServerSideProps(context) {\n // Fetch data from external API\n const res = await fetch(`${ENV_VAR}_search?q=${context.query.term}`)\n const data = await res.json()\n \n // Pass data to the page via props\n return { props: { data } }\n }\n\nexport default SearchPage"],"names":["React","useState","Results","AiOutlineClose","AiOutlineSearch","Link","useRef","useRouter","SearchPage","data","router","searchInput","setSearchInput","query","term","search","push","console","log","div","className","href","p","i","onClick","size","input","value","onChange","e","target","hits"],"mappings":"AAAA;;AAAA,OAAOA,SAASC,QAAQ,QAAQ,QAAO;AACvC,OAAOC,aAAa,wBAAuB;AAC3C,SAASC,cAAc,EAAEC,eAAe,QAAQ,iBAAgB;AAChE,OAAOC,UAAU,YAAW;AAC5B,SAASC,MAAM,QAAQ,QAAO;AAC9B,SAASC,SAAS,QAAQ,cAAa;AAIvC,MAAMC,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH;IACf,MAAM,CAACI,aAAaC,eAAe,GAAGX,SAASS,OAAOG,KAAK,CAACC,IAAI;IAEhE,MAAMC,SAAS,IAAM;QACnB,MAAMD,OAAOH;QACb,IAAG,CAACG,MAAM;QACVJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IAC9B;IAEAG,QAAQC,GAAG,CAACT;IAEZ,qBACE,QAACU;QAAIC,WAAU;;0BACX,QAACD;gBAAIC,WAAU;;kCACX,QAACD;wBAAIC,WAAU;kCACX,cAAA,QAACf;4BAAKgB,MAAK;sCAAI,cAAA,QAACC;gCAAEF,WAAU;0CAA8E;;;;;;;;;;;;;;;;kCAE9G,QAACD;wBAAIC,WAAU;;0CAmBX,QAACG;gCAAEH,WAAU;gCAAqDI,SAAS,IAAMT;0CAAU,cAAA,QAACX;oCAAgBqB,MAAM;;;;;;;;;;;0CAClH,QAACC;gCAAMC,OAAOhB;gCAAaiB,UAAU,CAACC,IAAMjB,eAAeiB,EAAEC,MAAM,CAACH,KAAK;gCAAGP,WAAU;;;;;;0CACtF,QAACG;gCAAEH,WAAU;gCAAkCI,SAAS,IAAMZ,eAAe;0CAAK,cAAA,QAACT;oCAAesB,MAAM;;;;;;;;;;;;;;;;;;;;;;;0BAGhH,QAACvB;gBAASO,MAAMA,KAAKsB,IAAI,CAACA,IAAI;;;;;;;;;;;;AAGtC;GA7CMvB;;QACWD;;;KADXC;;AAwDN,eAAeA,WAAU","file":"x"}e19T{}
(*Q<00><00><00><00><00><00>/5<00><00><00><00><00><00>
   = _C <00>
<00>
<00> <00> <00> <00> & ) X[<00><00><00><00><00><00><00><00><00><00>TW<00><00><00><00><00><00><00><00><00>M<><00><00><00><00><00><00>4B4BM <00>M<EFBFBD>@M<><00>%6o<00><00><00>5 Q <00>#<00>#o&<00>&<00><18><18><18><18><18><18><18>(0,next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter)<18>(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)<18>(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)<15><15><15><18>(next_link__WEBPACK_IMPORTED_MODULE_3___default())<15><18>undefined<15><15><15><15><15><18>react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineSearch<15><15><15><15><15><15><18>react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineClose<15><15><15><15><15><18>_components_Results__WEBPACK_IMPORTED_MODULE_2__["default"]<15><15><18>next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter<18><18>/* harmony default export */ __webpack_exports__["default"] = (<18><18>);<18>module<15><18>module.id<15><18>module.hot.accept<15><15><15><><EFBFBD><EFBFBD>source<63>size<7A>mapsE<><45><EFBFBD>!0__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "__N_SSP": function() { return /* binding */ __N_SSP; }
/* harmony export */ });
2023-01-04 02:30:44 +01:00
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Results__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/Results */ "./components/Results.js");
/* harmony import */ var react_icons_ai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-icons/ai */ "./node_modules/react-icons/ai/index.esm.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/link */ "./node_modules/next/link.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! next/router */ "./node_modules/next/router.js");
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_4__);
var _s = $RefreshSig$();
2023-01-04 02:30:44 +01:00
const SearchPage = (param)=>{
let { data } = param;
_s();
const router = (0,next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter)();
const [searchInput, setSearchInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(router.query.term);
const search = ()=>{
const term = searchInput;
if (!term) return;
router.push("/search?term=".concat(term));
};
console.log(data);
2023-01-04 02:30:44 +01:00
return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("div", {
className: "flex flex-col justify-center",
children: [
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("div", {
className: "flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]",
children: [
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("div", {
className: "p-10 w-[100vw] laptop:w-[25rem]",
children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), {
href: "/",
children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("p", {
className: "text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif ",
children: "KitabCitab"
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 32
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
columnNumber: 17
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
columnNumber: 13
}, undefined),
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("div", {
className: "group my-3 mx-auto py-5 h-[4vh] min-w-[90vw] bg-[#303134] border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl flex flex-row justify-around items-center tablet:w-[70vw] laptop:min-w-[40vw] laptop:w-[40vw] laptop:mx-0 laptop:my-10 laptop:justify-between ",
children: [
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("i", {
className: "rounded-3xl hover:border-black text-[#9aa0a6] px-3",
onClick: ()=>search(),
children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineSearch, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 108
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 47,
columnNumber: 17
}, undefined),
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("input", {
value: searchInput,
onChange: (e)=>setSearchInput(e.target.value),
className: "bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg "
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 48,
columnNumber: 17
}, undefined),
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)("i", {
className: "rounded-3xl text-[#9aa0a6] px-3",
onClick: ()=>setSearchInput(""),
children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineClose, {
size: 25
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 99
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 49,
columnNumber: 17
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 28,
columnNumber: 13
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 9
}, undefined),
/*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_components_Results__WEBPACK_IMPORTED_MODULE_2__["default"], {
data: data.hits.hits
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 52,
columnNumber: 9
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 23,
2023-01-04 02:30:44 +01:00
columnNumber: 5
}, undefined);
};
_s(SearchPage, "IsLZJYvJOe/NK3tDne6YdoM8MeY=", false, function() {
return [
next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter
];
});
_c = SearchPage;
var __N_SSP = true;
/* harmony default export */ __webpack_exports__["default"] = (SearchPage);
2023-01-04 02:30:44 +01:00
var _c;
$RefreshReg$(_c, "SearchPage");
2023-01-04 02:30:44 +01:00
;
// Wrapped in an IIFE to avoid polluting the global scope
;
(function () {
var _a, _b;
// Legacy CSS implementations will `eval` browser code in a Node.js context
// to extract CSS. For backwards compatibility, we need to check we're in a
// browser context before continuing.
if (typeof self !== 'undefined' &&
// AMP / No-JS mode does not inject these helpers:
'$RefreshHelpers$' in self) {
// @ts-ignore __webpack_module__ is global
var currentExports = module.exports;
// @ts-ignore __webpack_module__ is global
var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;
// This cannot happen in MainTemplate because the exports mismatch between
// templating and execution.
self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
// A module can be accepted automatically based on its exports, e.g. when
// it is a Refresh Boundary.
if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
// Save the previous exports on update so we can compare the boundary
// signatures.
module.hot.dispose(function (data) {
data.prevExports = currentExports;
});
// Unconditionally accept an update to this module, we'll check if it's
// still a Refresh Boundary later.
// @ts-ignore importMeta is replaced in the loader
module.hot.accept();
// This field is set when the previous version of this module was a
// Refresh Boundary, letting us know we need to check for invalidation or
// enqueue an update.
if (prevExports !== null) {
// A boundary can become ineligible if its exports are incompatible
// with the previous exports.
//
// For example, if you add/remove/change exports, we'll want to
// re-execute the importing modules, and force those components to
// re-render. Similarly, if you convert a class component to a
// function, we want to invalidate the boundary.
if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
module.hot.invalidate();
}
else {
self.$RefreshHelpers$.scheduleUpdate();
}
}
}
else {
// Since we just executed the code for the module, it's possible that the
// new exports made it ineligible for being a boundary.
// We only care about the case when we were _previously_ a boundary,
// because we already accepted this update (accidental side effect).
var isNoLongerABoundary = prevExports !== null;
if (isNoLongerABoundary) {
module.hot.invalidate();
}
}
}
})();
<01>{"filename":"[file].map[query]","module":true,"columns":true,"noSources":false,"namespace":"_N_E"}<02>map<61>bufferedMap<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD><EFBFBD>mappings<15><>sourcesContent<6E>names<03>x<1F>;;;;;;;;;;;;;;AAAA;;AAAuC;AACI;AACqB;AACpC;AACE;AACS;AAIvC,MAAMQ,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH,sDAASA;IACxB,MAAM,CAACI,aAAaC,eAAe,GAAGX,+CAAQA,CAACS,OAAOG,KAAK,CAACC,IAAI;IAEhE,MAAMC,SAAS,IAAM;QACnB,MAAMD,OAAOH;QACb,IAAG,CAACG,MAAM;QACVJ,OAAOM,IAAI,CAAC,gBAAqB,OAALF;IAC9B;IAEAG,QAAQC,GAAG,CAACT;IAEZ,qBACE,8DAACU;QAAIC,WAAU;;0BACX,8DAACD;gBAAIC,WAAU;;kCACX,8DAACD;wBAAIC,WAAU;kCACX,4EAACf,kDAAIA;4BAACgB,MAAK;sCAAI,4EAACC;gCAAEF,WAAU;0CAA8E;;;;;;;;;;;;;;;;kCAE9G,8DAACD;wBAAIC,WAAU;;0CAmBX,8DAACG;gCAAEH,WAAU;gCAAqDI,SAAS,IAAMT;0CAAU,4EAACX,2DAAeA;oCAACqB,MAAM;;;;;;;;;;;0CAClH,8DAACC;gCAAMC,OAAOhB;gCAAaiB,UAAU,CAACC,IAAMjB,eAAeiB,EAAEC,MAAM,CAACH,KAAK;gCAAGP,WAAU;;;;;;0CACtF,8DAACG;gCAAEH,WAAU;gCAAkCI,SAAS,IAAMZ,eAAe;0CAAK,4EAACT,0DAAcA;oCAACsB,MAAM;;;;;;;;;;;;;;;;;;;;;;;0BAGhH,8DAACvB,2DAAOA;gBAAEO,MAAMA,KAAKsB,IAAI,CAACA,IAAI;;;;;;;;;;;;AAGtC;GA7CMvB;;QACWD,kDAASA;;;KADpBC;;AAwDN,+DAAeA,UAAUA,EAAA<01>webpack://./pages/search.jsF import React, { useState } from 'react'
import Results from '../components/Results'
import { AiOutlineClose, AiOutlineSearch } from 'react-icons/ai'
import Link from 'next/link'
import { useRef } from 'react'
import { useRouter } from 'next/router'
import { ENV_VAR } from '../envconfig'
2023-01-04 02:30:44 +01:00
const SearchPage = ({data}) => {
const router = useRouter()
const [searchInput, setSearchInput] = useState(router.query.term)
2023-01-04 02:30:44 +01:00
const search = () => {
const term = searchInput
if(!term) return
router.push(`/search?term=${term}`)
}
2023-01-04 02:30:44 +01:00
console.log(data)
2023-01-04 02:30:44 +01:00
return (
<div className='flex flex-col justify-center'>
<div className="flex flex-col laptop:flex-row flex-wrap items-start w-[100vw] laptop:w-[80vw] laptop:h-[20vh] laptop:max-w-[90vw]">
<div className="p-10 w-[100vw] laptop:w-[25rem]">
<Link href='/'><p className="text-5xl tablet:text-6xl laptop:text-3xl text-white text-center font-serif ">KitabCitab</p></Link>
</div>
<div className="group
my-3
mx-auto
py-5
h-[4vh]
min-w-[90vw]
bg-[#303134]
border-[1px] w-[90vw] border-[#bdc1c6] rounded-3xl
flex flex-row justify-around items-center
tablet:w-[70vw]
laptop:min-w-[40vw]
laptop:w-[40vw]
laptop:mx-0
laptop:my-10
laptop:justify-between
"
>
<i className='rounded-3xl hover:border-black text-[#9aa0a6] px-3' onClick={() => search()}><AiOutlineSearch size={25}/></i>
<input value={searchInput} onChange={(e) => setSearchInput(e.target.value)} className="bg-[#303134] ml-5 w-[70%] active:border-none text-white outline-none text-lg "/>
<i className='rounded-3xl text-[#9aa0a6] px-3' onClick={() => setSearchInput("")}><AiOutlineClose size={25} /></i>
</div>
</div>
<Results data={data.hits.hits}/>
2023-01-04 02:30:44 +01:00
</div>
)
}
export async function getServerSideProps(context) {
// Fetch data from external API
const res = await fetch(`${ENV_VAR}_search?q=${context.query.term}`)
const data = await res.json()
// Pass data to the page via props
return { props: { data } }
}
export default SearchPage` <20>React<15><15><15><15><15><>useRef<15>H<><48><EFBFBD><15><>router<65>searchInput<75>setSearchInput<16><><EFBFBD><EFBFBD><EFBFBD>term<72>search<63>push<73>console<6C>log<6F>div<69>className<6D>href<65>p<EFBFBD>i<EFBFBD>onClick<15><>input<75>value<75>onChange<67>e<EFBFBD>target<65>hitsConcatSourceRawSource<1F>__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "__N_SSP": function() { return /* binding */ __N_SSP; }
/* harmony export */ });
2023-01-04 02:30:44 +01:00
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ "./node_modules/react/jsx-dev-runtime.js");
/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _components_Results__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/Results */ "./components/Results.js");
/* harmony import */ var react_icons_ai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-icons/ai */ "./node_modules/react-icons/ai/index.esm.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! next/link */ "./node_modules/next/link.js");
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! next/router */ "./node_modules/next/router.js");
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_4__);
ReplaceSourceSourceMapSource<16><><EFBFBD><EFBFBD><16><><EFBFBD><EFBFBD>hfalse057undefined84123undefined125168undefined170234undefined236264undefined266296undefined298337undefined425433(0,next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter)undefined480487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined701707(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined815821(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined10381044(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined11731179(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined11811184(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined12801286(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined17721775undefinedundefined20582061undefinedundefined23242327undefinedundefined23652371(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined27502756(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined29732979(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined29812995react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineSearchundefined33663369undefinedundefined36723675undefinedundefined37213727(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined42944297undefinedundefined43434349(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined45574563(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined45654578react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineCloseundefined49484951undefinedundefined52545257undefinedundefined55455548undefinedundefined57875790undefinedundefined58205826(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined58285834_components_Results__WEBPACK_IMPORTED_MODULE_2__["default"]undefined60956098undefinedundefined62896292undefinedundefined63876395next_router__WEBPACK_IMPORTED_MODULE_4__.useRouterundefined64256431undefined64526466/* harmony default export */ __webpack_exports__["default"] = (undefined64526466undefined64776477.5);undefined70807097moduleundefined72057222moduleundefined75357555module.idundefined78997916moduleundefined82458273module.hot.acceptundefined91579174moduleundefined98399856moduleundefined <07>__webpack_require__<5F>__webpack_require__.n%<25><><EFBFBD><EFBFBD>__webpack_require__.r<16><><EFBFBD><EFBFBD>b<><62><EFBFBD><EFBFBD>__webpack_require__.d<18>7d4f30246bc4436a