feat: use nextjs 13 links

This commit is contained in:
spencerwooo
2023-01-26 13:43:00 +08:00
parent aa9df292f8
commit 3744aa13d4
6 changed files with 36 additions and 43 deletions
+17 -17
View File
@@ -90,24 +90,24 @@ function SearchResultItemTemplate({
disabled: boolean
}) {
return (
<Link href={driveItemPath} passHref>
<a
className={`flex items-center space-x-4 border-b border-gray-400/30 px-4 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-850 ${
disabled ? 'pointer-events-none cursor-not-allowed' : 'cursor-pointer'
}`}
>
<FontAwesomeIcon icon={driveItem.file ? getFileIcon(driveItem.name) : ['far', 'folder']} />
<div>
<div className="text-sm font-medium leading-8">{driveItem.name}</div>
<div
className={`overflow-hidden truncate font-mono text-xs opacity-60 ${
itemDescription === 'Loading ...' && 'animate-pulse'
}`}
>
{itemDescription}
</div>
<Link
href={driveItemPath}
passHref
className={`flex items-center space-x-4 border-b border-gray-400/30 px-4 py-1.5 hover:bg-gray-50 dark:hover:bg-gray-850 ${
disabled ? 'pointer-events-none cursor-not-allowed' : 'cursor-pointer'
}`}
>
<FontAwesomeIcon icon={driveItem.file ? getFileIcon(driveItem.name) : ['far', 'folder']} />
<div>
<div className="text-sm font-medium leading-8">{driveItem.name}</div>
<div
className={`overflow-hidden truncate font-mono text-xs opacity-60 ${
itemDescription === 'Loading ...' && 'animate-pulse'
}`}
>
{itemDescription}
</div>
</a>
</div>
</Link>
)
}