Skip to content

Commit f53538a

Browse files
committed
add append code option
1 parent 70a9e4f commit f53538a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/components/command-palette.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,24 @@ export const CommandPalette = () => {
174174
/>
175175
<div className="flex justify-end space-x-2">
176176
<CopyButton text={response} />
177+
<button
178+
type="button"
179+
className={cn(
180+
'overflow-hidden rounded-full py-1 pl-2 pr-3 text-xs font-medium backdrop-blur transition hover:text-gray-high-contrast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-app'
181+
)}
182+
onClick={() => {
183+
setQuery(response);
184+
setIsOpen(false);
185+
}}
186+
>
187+
<span
188+
className={cn(
189+
'pointer-events-none flex items-center gap-1 transition duration-300'
190+
)}
191+
>
192+
Replace code &crarr;
193+
</span>
194+
</button>
177195
<button
178196
type="button"
179197
className={cn(
@@ -189,7 +207,7 @@ export const CommandPalette = () => {
189207
'pointer-events-none flex items-center gap-1 transition duration-300'
190208
)}
191209
>
192-
insert code &crarr;
210+
Append result &crarr;
193211
</span>
194212
</button>
195213
</div>

0 commit comments

Comments
 (0)