style: format
This commit is contained in:
parent
ce107072a4
commit
75ca17c5b3
3 changed files with 8 additions and 5 deletions
|
@ -27,7 +27,8 @@ const VersionChooser = ({
|
|||
|
||||
const fileEnding = file === 'other' ? '' : `.${file}`
|
||||
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 bibtex = `@article{
|
||||
|
|
|
@ -74,7 +74,7 @@ export default function Page() {
|
|||
const router = useRouter()
|
||||
const searchParams = useSearchParams()
|
||||
const search = decodeURIComponent(searchParams.get('q') as string)
|
||||
|
||||
|
||||
let invalid = false
|
||||
|
||||
if (search.toLowerCase().startsWith('eexiv')) {
|
||||
|
@ -120,7 +120,7 @@ export default function Page() {
|
|||
{search}
|
||||
{`"`}
|
||||
</h1>
|
||||
{(data.length === 0 || invalid) ? (
|
||||
{data.length === 0 || invalid ? (
|
||||
<p className='text-lg px-2'>No results found.</p>
|
||||
) : (
|
||||
data.map((result) => (
|
||||
|
|
|
@ -62,7 +62,7 @@ const serializeDoc = (key: string, value: Document) => ({
|
|||
)
|
||||
.join(' '),
|
||||
key: key,
|
||||
doi: value.doi ? value.doi : undefined
|
||||
doi: value.doi ? value.doi : undefined,
|
||||
})
|
||||
|
||||
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
|
||||
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)
|
||||
postMessage(miniSearch.search(e.data) as CustomSearchResult[])
|
||||
|
|
Loading…
Reference in a new issue