mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 20:04:26 +00:00
fix(search): address code review feedback on colors, race conditions, and utilities
This commit is contained in:
@@ -13,6 +13,7 @@ import { Download } from 'lucide-react'
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { useInView } from 'react-intersection-observer'
|
||||
import { toast } from 'sonner'
|
||||
import { formatSize } from '@/ui/lib/format'
|
||||
import type { DragState } from '../dnd-types'
|
||||
import { FileBrowserContextMenu } from './context-menu'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
@@ -395,12 +396,6 @@ export function FileBrowser({
|
||||
return `${count} ${isFile ? 'Asset' : 'Folder'}${count !== 1 ? 's' : ''}`
|
||||
}
|
||||
|
||||
const formatSize = (bytes: number) => {
|
||||
if (bytes < 1024) return `${bytes} B`
|
||||
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`
|
||||
return `${(bytes / (1024 * 1024)).toFixed(0)} MB`
|
||||
}
|
||||
|
||||
const handleEmptyAreaClick = (e: React.MouseEvent) => {
|
||||
const target = e.target as HTMLElement
|
||||
// Clear selection if we didn't click on a card/row, button, or other interactive element
|
||||
|
||||
Reference in New Issue
Block a user