feat(file-browser): add copy name and path option to context menu

This commit is contained in:
yiling
2026-07-27 10:23:22 +08:00
parent d81fc09b35
commit f429873362
20 changed files with 284 additions and 13 deletions
@@ -14,6 +14,7 @@ import {
} from '@/ui/components/ui/table'
import { Loader2, Plus, Trash2, Copy, Check } from 'lucide-react'
import { toast } from 'sonner'
import { copyToClipboard } from '@/ui/lib/clipboard'
import type { ApiTokenResponse } from '@shumai/dtos'
import { m } from '@/ui/paraglide/messages.js'
@@ -75,8 +76,8 @@ export function DeveloperSettings({ teamId }: { teamId: string }) {
createToken(tokenName.trim())
}
const handleCopy = (id: string, token: string) => {
navigator.clipboard.writeText(token)
const handleCopy = async (id: string, token: string) => {
await copyToClipboard(token)
setCopiedId(id)
toast.success(m.copied_api_token_to_clipboard())
setTimeout(() => setCopiedId(null), 2000)