style: format

This commit is contained in:
quantum9Innovation 2024-02-16 19:39:55 +00:00 committed by github-actions[bot]
parent ce107072a4
commit 75ca17c5b3
3 changed files with 8 additions and 5 deletions

View file

@ -27,7 +27,8 @@ const VersionChooser = ({
const fileEnding = file === 'other' ? '' : `.${file}` const fileEnding = file === 'other' ? '' : `.${file}`
const [selectedRevision, setSelectedRevision] = useState<number>(latest) // Initialize the selected revision with the latest revision const [selectedRevision, setSelectedRevision] = useState<number>(latest) // Initialize the selected revision with the latest revision
const notifyCopied = (content: string) => toast.success(`${content} copied to clipboard!`) const notifyCopied = (content: string) =>
toast.success(`${content} copied to clipboard!`)
const handleClick = () => { const handleClick = () => {
const bibtex = `@article{ const bibtex = `@article{

View file

@ -74,7 +74,7 @@ export default function Page() {
const router = useRouter() const router = useRouter()
const searchParams = useSearchParams() const searchParams = useSearchParams()
const search = decodeURIComponent(searchParams.get('q') as string) const search = decodeURIComponent(searchParams.get('q') as string)
let invalid = false let invalid = false
if (search.toLowerCase().startsWith('eexiv')) { if (search.toLowerCase().startsWith('eexiv')) {
@ -120,7 +120,7 @@ export default function Page() {
{search} {search}
{`"`} {`"`}
</h1> </h1>
{(data.length === 0 || invalid) ? ( {data.length === 0 || invalid ? (
<p className='text-lg px-2'>No results found.</p> <p className='text-lg px-2'>No results found.</p>
) : ( ) : (
data.map((result) => ( data.map((result) => (

View file

@ -62,7 +62,7 @@ const serializeDoc = (key: string, value: Document) => ({
) )
.join(' '), .join(' '),
key: key, key: key,
doi: value.doi ? value.doi : undefined doi: value.doi ? value.doi : undefined,
}) })
onmessage = (e: MessageEvent<string>) => { onmessage = (e: MessageEvent<string>) => {
@ -95,7 +95,9 @@ onmessage = (e: MessageEvent<string>) => {
} }
// converting the documents object into an array that can be index by minisearch // converting the documents object into an array that can be index by minisearch
const docs = Object.entries(documents).map(([key, value]) => (serializeDoc(key, value))) const docs = Object.entries(documents).map(([key, value]) =>
serializeDoc(key, value)
)
miniSearch.addAll(docs) miniSearch.addAll(docs)
postMessage(miniSearch.search(e.data) as CustomSearchResult[]) postMessage(miniSearch.search(e.data) as CustomSearchResult[])