File tree Expand file tree Collapse file tree
src/lib/components/chat/FileNav Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import { toast } from ' svelte-sonner' ;
23 import { getContext , tick , onDestroy } from ' svelte' ;
34 import { formatFileSize } from ' $lib/utils' ;
45 import type { FileEntry } from ' $lib/apis/terminal' ;
89 import EllipsisHorizontal from ' ../../icons/EllipsisHorizontal.svelte' ;
910 import GarbageBin from ' ../../icons/GarbageBin.svelte' ;
1011 import Pencil from ' ../../icons/Pencil.svelte' ;
12+ import Clipboard from ' ../../icons/Clipboard.svelte' ;
1113
1214 const i18n = getContext (' i18n' );
1315
315317 <div class ="flex items-center" >{$i18n .t (' Download' )}</div >
316318 </button >
317319
320+ <button
321+ type =" button"
322+ class =" select-none flex rounded-xl py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition items-center gap-2 text-sm"
323+ on:click ={(e ) => {
324+ e .stopPropagation ();
325+ const path =
326+ entry .type === ' directory'
327+ ? ` ${currentPath }${entry .name }/ `
328+ : ` ${currentPath }${entry .name } ` ;
329+ navigator .clipboard .writeText (path ).then (() => {
330+ toast .success ($i18n .t (' Path copied' ));
331+ });
332+ }}
333+ >
334+ <Clipboard className =" size-4" strokeWidth =" 1.5" />
335+ <div class ="flex items-center" >{$i18n .t (' Copy Path' )}</div >
336+ </button >
337+
318338 <button
319339 type =" button"
320340 class =" select-none flex rounded-xl py-1.5 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition items-center gap-2 text-sm"
You can’t perform that action at this time.
0 commit comments