mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
@@ -1,4 +1,4 @@
|
||||
import { useState, useImperativeHandle, useRef, useEffect } from 'react'
|
||||
import { useState, useImperativeHandle, useRef, useEffect, Fragment } from 'react'
|
||||
import algoliasearch from 'algoliasearch'
|
||||
import replaceSearchResult from '@/components/Mark'
|
||||
import Link from 'next/link'
|
||||
@@ -7,6 +7,22 @@ import throttle from 'lodash/throttle'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
const ShortCutActions = [
|
||||
{
|
||||
key: '↑ ↓',
|
||||
action: '选择'
|
||||
},
|
||||
{
|
||||
key: 'Enter',
|
||||
action: '跳转'
|
||||
},
|
||||
{
|
||||
key: 'Esc',
|
||||
action: '关闭'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
/**
|
||||
* 结合 Algolia 实现的弹出式搜索框
|
||||
* 打开方式 cRef.current.openSearch()
|
||||
@@ -234,6 +250,15 @@ export default function AlgoliaSearchModal({ cRef }) {
|
||||
</ul>
|
||||
<Pagination totalPage={totalPage} page={page} switchPage={switchPage} />
|
||||
<div className='flex items-center justify-between mt-2 sm:text-sm text-xs dark:text-gray-300'>
|
||||
{totalHit === 0 && (<div className='flex items-center'>
|
||||
{
|
||||
ShortCutActions.map((action, index) => {
|
||||
return <Fragment key={index}><div className='border-gray-300 dark:text-gray-300 text-gray-600 px-2 rounded border inline-block'>{action.key}</div>
|
||||
<span className='ml-2 mr-4 text-gray-600 dark:text-gray-300'>{action.action}</span></Fragment>
|
||||
})
|
||||
}
|
||||
</div>)
|
||||
}
|
||||
<div>
|
||||
{totalHit > 0 && (
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user