|
3 | 3 | import { useState } from 'react' |
4 | 4 | import { Check, Clipboard } from 'lucide-react' |
5 | 5 | import { |
6 | | - Badge, |
7 | 6 | Button, |
8 | 7 | ButtonGroup, |
9 | 8 | ButtonGroupItem, |
10 | 9 | Code, |
| 10 | + Combobox, |
11 | 11 | Label, |
12 | | - Popover, |
13 | | - PopoverContent, |
14 | | - PopoverItem, |
15 | | - PopoverTrigger, |
16 | 12 | Tooltip, |
17 | 13 | } from '@/components/emcn' |
18 | 14 | import { Skeleton } from '@/components/ui' |
@@ -602,48 +598,19 @@ console.log(limits);` |
602 | 598 | <span>{copied.async ? 'Copied' : 'Copy'}</span> |
603 | 599 | </Tooltip.Content> |
604 | 600 | </Tooltip.Root> |
605 | | - <Popover> |
606 | | - <PopoverTrigger asChild> |
607 | | - <div className='min-w-0 max-w-full'> |
608 | | - <Badge |
609 | | - variant='outline' |
610 | | - className='flex-none cursor-pointer whitespace-nowrap rounded-[6px]' |
611 | | - > |
612 | | - <span className='whitespace-nowrap text-[12px]'> |
613 | | - {getAsyncExampleTitle()} |
614 | | - </span> |
615 | | - </Badge> |
616 | | - </div> |
617 | | - </PopoverTrigger> |
618 | | - <PopoverContent |
619 | | - side='bottom' |
620 | | - align='end' |
621 | | - sideOffset={4} |
622 | | - maxHeight={300} |
623 | | - maxWidth={300} |
624 | | - minWidth={160} |
625 | | - border |
626 | | - > |
627 | | - <PopoverItem |
628 | | - active={asyncExampleType === 'execute'} |
629 | | - onClick={() => setAsyncExampleType('execute')} |
630 | | - > |
631 | | - Execute Job |
632 | | - </PopoverItem> |
633 | | - <PopoverItem |
634 | | - active={asyncExampleType === 'status'} |
635 | | - onClick={() => setAsyncExampleType('status')} |
636 | | - > |
637 | | - Check Status |
638 | | - </PopoverItem> |
639 | | - <PopoverItem |
640 | | - active={asyncExampleType === 'rate-limits'} |
641 | | - onClick={() => setAsyncExampleType('rate-limits')} |
642 | | - > |
643 | | - Rate Limits |
644 | | - </PopoverItem> |
645 | | - </PopoverContent> |
646 | | - </Popover> |
| 601 | + <Combobox |
| 602 | + size='sm' |
| 603 | + className='!w-fit !py-[2px] min-w-[100px] rounded-[6px] px-[9px]' |
| 604 | + options={[ |
| 605 | + { label: 'Execute Job', value: 'execute' }, |
| 606 | + { label: 'Check Status', value: 'status' }, |
| 607 | + { label: 'Rate Limits', value: 'rate-limits' }, |
| 608 | + ]} |
| 609 | + value={asyncExampleType} |
| 610 | + onChange={(value) => setAsyncExampleType(value as AsyncExampleType)} |
| 611 | + align='end' |
| 612 | + dropdownWidth={160} |
| 613 | + /> |
647 | 614 | </div> |
648 | 615 | </div> |
649 | 616 | <Code.Viewer |
|
0 commit comments