File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
frontend/src/lib/components/message Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 44 import { _ } from ' svelte-i18n' ;
55
66 let { content = ' ' , token = 0 , cost = 0.0 } = $props ();
7+ let showUsage = $derived (token > 0 );
78 </script >
89
910<div class =" flex justify-end space-x-1 duration-150 group-hover:visible md:invisible" >
1011 <div class =" group/usage relative flex space-x-1" >
11- <CircleDollarSign
12- class =" h-10 w-10 rounded-lg p-2 duration-150 group-hover/usage:bg-primary group-hover/usage:text-text-hover"
13- />
12+ {#if showUsage }
13+ <CircleDollarSign
14+ class =" h-10 w-10 rounded-lg p-2 duration-150 group-hover/usage:bg-primary group-hover/usage:text-text-hover"
15+ />
1416
15- <div
16- class =" absolute top-0 right-13 flex h-10 w-sm items-center justify-end duration-150 group-hover/usage:visible md:invisible"
17- >
18- <div class =" rounded-md bg-secondary p-2 select-none" >
19- {token } token/${cost .toFixed (4 )}
17+ <div
18+ class =" absolute top-0 right-13 flex h-10 w-sm items-center justify-end duration-150 group-hover/usage:visible md:invisible"
19+ >
20+ <div class =" rounded-md bg-secondary p-2 select-none" >
21+ {token } token/${cost .toFixed (4 )}
22+ </div >
2023 </div >
21- </ div >
24+ { /if }
2225 </div >
2326 <button onclick ={() => copy (content )} aria-label =" copy response" >
2427 <ClipboardCopy
You can’t perform that action at this time.
0 commit comments