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

687 lines
62 KiB
Plaintext
Raw Normal View History

2023-03-08 12:08:29 +01:00
wpc<00><><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> `<60>OokxB <10>OokxB <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/SourceMapSourceq'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 { useRouter } from "next/router";
const SearchPage = (param)=>{
let { data } = param;
_s();
const router = useRouter();
const [searchInput, setSearchInput] = useState(router.query.term);
const term = searchInput;
const search = ()=>{
if (!term) return;
router.push("/search?term=".concat(term));
};
const enterHandler = (e)=>{
if (e.key === "Enter" && term !== "") router.push("/search?term=".concat(term));
};
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: 27,
columnNumber: 32
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 27,
columnNumber: 17
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
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: 48,
columnNumber: 108
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 48,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("input", {
onKeyDown: (e)=>enterHandler(e),
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: 49,
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: 50,
columnNumber: 99
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 50,
columnNumber: 17
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 29,
columnNumber: 13
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
columnNumber: 9
}, this),
/*#__PURE__*/ _jsxDEV(Results, {
data: data.hits.hits,
term: searchInput
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 53,
columnNumber: 9
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 5
}, this);
2023-02-16 00:05:13 +01:00
};
2023-03-08 12:08:29 +01:00
_s(SearchPage, "IsLZJYvJOe/NK3tDne6YdoM8MeY=", false, function() {
return [
useRouter
];
});
_c = SearchPage;
export var __N_SSP = true;
export default SearchPage;
var _c;
$RefreshReg$(_c, "SearchPage");
;
// 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 { 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 const term = searchInput\n\n const search = () => {\n if(!term) return\n router.push(`/search?term=${term}`)\n }\n\n const enterHandler = (e) => {\n if(e.key === \"Enter\" && term !== \"\") router.push(`/search?term=${term}`)\n }\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 onKeyDown={(e) => enterHandler(e)} 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} term={searchInput}/>\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","useRouter","SearchPage","data","router","searchInput","setSearchInput","query","term","search","push","enterHandler","e","key","div","className","href","p","i","onClick","size","input","onKeyDown","value","onChange","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,SAAS,QAAQ,cAAa;AAIvC,MAAMC,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH;IACf,MAAM,CAACI,aAAaC,eAAe,GAAGV,SAASQ,OAAOG,KAAK,CAACC,IAAI;IAChE,MAAMA,OAAOH;IAEb,MAAMI,SAAS,IAAM;QACnB,IAAG,CAACD,MAAM;QACVJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IAC9B;IAEA,MAAMG,eAAe,CAACC,IAAM;QAC1B,IAAGA,EAAEC,GAAG,KAAK,WAAWL,SAAS,IAAIJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IACnE;IAEA,qBACE,QAACM;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,IAAMV;0CAAU,cAAA,QAACV;oCAAgBqB,MAAM;;;;;;;;;;;0CAClH,QAACC;gCAAMC,WAAW,CAACV,IAAMD,aAAaC;gCAAIW,OAAOlB;gCAAamB,UAAU,CAACZ,IAAMN,eAAeM,EAAEa,MAAM,CAACF,KAAK;gCAAGR,WAAU;;;;;;0CACzH,QAACG;gCAA
2 `(<10>webpack/lib/dependencies/HarmonyExportHeaderDependency A<><00> A<><00> c}}<02>undefined A15 c&&#<15> AOS c++<15> AY ]  c00<15> Ak o  c=#='<15> A<><00> cBB#<15> ALP cLL#<15> A<><00> cV#V'<15> A  c[[#<15> A/3 caa<15> A!% cgg<15> Ax| coo<15> A:> cuu  A<><00> A<><00> c~~(<28><><EFBFBD> AQc'<27><><EFBFBD> @<40>`!@<40>`3%<25><><EFBFBD> A<><00>$<24><><EFBFBD> @<40>`*@<40>`<<02>module.id A-<15> @<40>`Q@<40>`f<1E><><EFBFBD> A<><00><1D><><EFBFBD> @<40>`@<40>`"<02>module.hot.accept A<> <00> <19><><EFBFBD> @<40>`@<40>`/<17><><EFBFBD> An$<00>$<16><><EFBFBD> @<40>`@<40>`*<14><><EFBFBD> A'*'<13><><EFBFBD> @<40>`@<40>`& `<10>webpack/lib/dependencies/HarmonyImportSideEffectDependency<18>react/jsx-dev-runtime<15> `::<3A><><EFBFBD>:<3A><><EFBFBD> `(<18>../components/Results<15> `,<18>react-icons/ai<15> `A<18>next/link<15> `<18>next/router<15> `(<10>webpack/lib/dependencies/HarmonyImportSpecifierDependencya <01>useRouter<15> A<><00> <15><15><15> c   <01>useState<15> A<><00> *<2A><><EFBFBD>*<2A><><EFBFBD><15> c * 2 <01>jsxDEV<17>_jsxDEV A  <15><15><15> c  <15><15> At{ <15><15><15> c! <15><15> ASZ <15><15><15> c") <15><15> A<><00> <15><15><15> c07 <01>default<17>Link A<><00>  <15><15><15> c8< <15><15> AEL <15><15><15> c4; <15><15> A<> <00>  <15><15><15> c1"1) <15><15> A
 <15><15><15> c4*41 <15><15> A<> <00>  <15><15><15> c787? <01>AiOutlineSearch<15> A<> <00>   <15><15><15> c7@7O <15><15> A<><00> <15><15><15> cC*C1 <15><15> A}<00> <15><15><15> cM*M1 <15><15> ASZ <15><15><15> cP8P? <01>AiOutlineClose<15> A[i  <15><15><15> cP@PN <15><15> ABI <15><15><15> chh! <15><17>Results AJQ  <15><15><15> ch"h) <15><15> A<><00>  <15><15><15> cyy<10>webpack/lib/dependencies/HarmonyExportSpecifierDependency@j<><6A><EFBFBD>j<><6A><EFBFBD> c}}<10>webpack/lib/dependencies/HarmonyExportExpressionDependency`<60><15><> c~~  <04>sources<65>runtimeRequirements<74>dataM<><4D><EFBFBD><01>javascript<10>webpack/lib/util/registerExternalSerializer<65>webpack-sources/CachedSource `D<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 */ });
/* 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/SourceMapSourceq'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 { useRouter } from "next/router";
const SearchPage = (param)=>{
let { data } = param;
_s();
const router = useRouter();
const [searchInput, setSearchInput] = useState(router.query.term);
const term = searchInput;
const search = ()=>{
if (!term) return;
router.push("/search?term=".concat(term));
};
const enterHandler = (e)=>{
if (e.key === "Enter" && term !== "") router.push("/search?term=".concat(term));
};
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: 27,
columnNumber: 32
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 27,
columnNumber: 17
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
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: 48,
columnNumber: 108
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 48,
columnNumber: 17
}, this),
/*#__PURE__*/ _jsxDEV("input", {
onKeyDown: (e)=>enterHandler(e),
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: 49,
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: 50,
columnNumber: 99
}, this)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 50,
columnNumber: 17
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 29,
columnNumber: 13
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
columnNumber: 9
}, this),
/*#__PURE__*/ _jsxDEV(Results, {
data: data.hits.hits,
term: searchInput
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 53,
columnNumber: 9
}, this)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 5
}, this);
2023-02-16 00:05:13 +01:00
};
2023-03-08 12:08:29 +01:00
_s(SearchPage, "IsLZJYvJOe/NK3tDne6YdoM8MeY=", false, function() {
return [
useRouter
];
});
_c = SearchPage;
export var __N_SSP = true;
export default SearchPage;
var _c;
$RefreshReg$(_c, "SearchPage");
;
// 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 { 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 const term = searchInput\n\n const search = () => {\n if(!term) return\n router.push(`/search?term=${term}`)\n }\n\n const enterHandler = (e) => {\n if(e.key === \"Enter\" && term !== \"\") router.push(`/search?term=${term}`)\n }\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 onKeyDown={(e) => enterHandler(e)} 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} term={searchInput}/>\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","useRouter","SearchPage","data","router","searchInput","setSearchInput","query","term","search","push","enterHandler","e","key","div","className","href","p","i","onClick","size","input","onKeyDown","value","onChange","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,SAAS,QAAQ,cAAa;AAIvC,MAAMC,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH;IACf,MAAM,CAACI,aAAaC,eAAe,GAAGV,SAASQ,OAAOG,KAAK,CAACC,IAAI;IAChE,MAAMA,OAAOH;IAEb,MAAMI,SAAS,IAAM;QACnB,IAAG,CAACD,MAAM;QACVJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IAC9B;IAEA,MAAMG,eAAe,CAACC,IAAM;QAC1B,IAAGA,EAAEC,GAAG,KAAK,WAAWL,SAAS,IAAIJ,OAAOM,IAAI,CAAC,AAAC,gBAAoB,OAALF;IACnE;IAEA,qBACE,QAACM;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,IAAMV;0CAAU,cAAA,QAACV;oCAAgBqB,MAAM;;;;;;;;;;;0CAClH,QAACC;gCAAMC,WAAW,CAACV,IAAMD,aAAaC;gCAAIW,OAAOlB;gCAAamB,UAAU,CAACZ,IAAMN,eAAeM,EAAEa,MAAM,CAACF,KAAK;gCAAGR,WAAU;;;;;;0CACzH,QAACG;gCAA
1<00><00><00><00>tzSY<00><00><00><00>EK14ORY \ <00> <00>  _ <00> <00> <00> <00> k n <00><00><00><00>LO}<00>SY[h<00><00> /2!$BHJPxK{:=<00><00><00><00><00><00><00><00><00> <00><><EFBFBD>@MQb<00><00>,<00><00><00> <00> n$$')'<00><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><18><><EFBFBD><EFBFBD>source<63>size<7A>mapsH<><48><EFBFBD><1F>0__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "__N_SSP": function() { return /* binding */ __N_SSP; }
/* harmony export */ });
/* 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$();
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 term = searchInput;
const search = ()=>{
if (!term) return;
router.push("/search?term=".concat(term));
};
const enterHandler = (e)=>{
if (e.key === "Enter" && term !== "") router.push("/search?term=".concat(term));
};
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: 27,
columnNumber: 32
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 27,
columnNumber: 17
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 26,
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: 48,
columnNumber: 108
}, undefined)
}, 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)("input", {
onKeyDown: (e)=>enterHandler(e),
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: 49,
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: 50,
columnNumber: 99
}, undefined)
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 50,
columnNumber: 17
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 29,
columnNumber: 13
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 25,
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,
term: searchInput
}, void 0, false, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 53,
columnNumber: 9
}, undefined)
]
}, void 0, true, {
fileName: "/home/ismail/Desktop/KitabCitab/kitabcitab-frontend/kitabcitab/pages/search.js",
lineNumber: 24,
columnNumber: 5
}, undefined);
2023-02-16 00:05:13 +01:00
};
2023-03-08 12:08:29 +01:00
_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);
var _c;
$RefreshReg$(_c, "SearchPage");
;
// 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;;;;;;;;;;;;;;AAAA;;AAAuC;AACI;AACqB;AACpC;AACW;AAIvC,MAAMO,aAAa,SAAY;QAAX,EAACC,KAAI,EAAC;;IACxB,MAAMC,SAASH,sDAASA;IACxB,MAAM,CAACI,aAAaC,eAAe,GAAGV,+CAAQA,CAACQ,OAAOG,KAAK,CAACC,IAAI;IAChE,MAAMA,OAAOH;IAEb,MAAMI,SAAS,IAAM;QACnB,IAAG,CAACD,MAAM;QACVJ,OAAOM,IAAI,CAAC,gBAAqB,OAALF;IAC9B;IAEA,MAAMG,eAAe,CAACC,IAAM;QAC1B,IAAGA,EAAEC,GAAG,KAAK,WAAWL,SAAS,IAAIJ,OAAOM,IAAI,CAAC,gBAAqB,OAALF;IACnE;IAEA,qBACE,8DAACM;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,IAAMV;0CAAU,4EAACV,2DAAeA;oCAACqB,MAAM;;;;;;;;;;;0CAClH,8DAACC;gCAAMC,WAAW,CAACV,IAAMD,aAAaC;gCAAIW,OAAOlB;gCAAamB,UAAU,CAACZ,IAAMN,eAAeM,EAAEa,MAAM,CAACF,KAAK;gCAAGR,WAAU;;;;;;0CACzH,8DAACG;gCAAEH,WAAU;gCAAkCI,SAAS,IAAMb,eAAe;0CAAK,4EAACR,0DAAcA;oCAACsB,MAAM;;;;;;;;;;;;;;;;;;;;;;;0BAGhH,8DAACvB,2DAAOA;gBAAEM,MAAMA,KAAKuB,IAAI,CAACA,IAAI;gBAAElB,MAAMH;;;;;;;;;;;;AAG9C;GA/CMH;;QACWD,kDAASA;;;KADpBC;;AA0DN,+DAAeA,UAAUA,EAAA<01>webpack://./pages/search.js<1F> import React, { useState } from 'react'
import Results from '../components/Results'
import { AiOutlineClose, AiOutlineSearch } from 'react-icons/ai'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { ENV_VAR } from '../envconfig'
const SearchPage = ({data}) => {
const router = useRouter()
const [searchInput, setSearchInput] = useState(router.query.term)
const term = searchInput
const search = () => {
if(!term) return
router.push(`/search?term=${term}`)
}
const enterHandler = (e) => {
if(e.key === "Enter" && term !== "") router.push(`/search?term=${term}`)
}
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 onKeyDown={(e) => enterHandler(e)} 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} term={searchInput}/>
</div>
)
2023-02-16 00:05:13 +01:00
}
2022-12-28 22:09:58 +01:00
2023-03-08 12:08:29 +01:00
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><15>L<><4C><EFBFBD><15><>router<65>searchInput<75>setSearchInput<16><><EFBFBD><EFBFBD><EFBFBD>term<72>search<63>push<73>enterHandler<65>e<EFBFBD>key<65>div<69>className<6D>href<65>p<EFBFBD>i<EFBFBD>onClick<15><>input<75>onKeyDown<77>value<75>onChange<67>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 */ });
/* 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>[false057undefined84123undefined125168undefined170234undefined236264undefined266305undefined393401(0,next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter)undefined448455(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined770776(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined884890(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined11071113(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined12421248(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined12501253(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined13491355(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined18411844undefinedundefined21272130undefinedundefined23932396undefinedundefined24342440(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined28192825(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined30423048(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined30503064react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineSearchundefined34353438undefinedundefined37413744undefinedundefined37903796(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined44284431undefinedundefined44774483(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined46914697(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined46994712react_icons_ai__WEBPACK_IMPORTED_MODULE_5__.AiOutlineCloseundefined50825085undefinedundefined53885391undefinedundefined56795682undefinedundefined59215924undefinedundefined59545960(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)undefined59625968_components_Results__WEBPACK_IMPORTED_MODULE_2__["default"]undefined62646267undefinedundefined64586461undefinedundefined65566564next_router__WEBPACK_IMPORTED_MODULE_4__.useRouterundefined65946600undefined66216635/* harmony default export */ __webpack_exports__["default"] = (undefined66216635undefined66466646.5);undefined72497266moduleundefined73747391moduleundefined77047724module.idundefined80688085moduleundefined84148442module.hot.acceptundefined93269343moduleundefined1000810025moduleundefined <07>__webpack_require__<5F>__webpack_require__.n(<28><><EFBFBD><EFBFBD>__webpack_require__.r<16><><EFBFBD><EFBFBD>c<><63><EFBFBD><EFBFBD>__webpack_require__.d<18>f582f3aeb73cd237