mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-07 01:56:53 +00:00
fix: migrate select to Base UI items API (#4655)
This commit is contained in:
+21
-7
@@ -6,6 +6,7 @@ import { Button } from '@/components/ui/button'
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
@@ -183,19 +184,32 @@ export function UserSubscriptionsDialog(props: Props) {
|
||||
<div className='mt-4 space-y-4'>
|
||||
<div className='flex gap-2'>
|
||||
<Select
|
||||
items={[
|
||||
...plans.map((p) => ({
|
||||
value: String(p.plan.id),
|
||||
label: (
|
||||
<>
|
||||
{p.plan.title}($
|
||||
{Number(p.plan.price_amount || 0).toFixed(2)})
|
||||
</>
|
||||
),
|
||||
})),
|
||||
]}
|
||||
value={selectedPlanId}
|
||||
onValueChange={(v) => v !== null && setSelectedPlanId(v)}
|
||||
>
|
||||
<SelectTrigger className='flex-1'>
|
||||
<SelectValue placeholder={t('Select subscription plan')} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{plans.map((p) => (
|
||||
<SelectItem key={p.plan.id} value={String(p.plan.id)}>
|
||||
{p.plan.title} ($
|
||||
{Number(p.plan.price_amount || 0).toFixed(2)})
|
||||
</SelectItem>
|
||||
))}
|
||||
<SelectContent alignItemWithTrigger={false}>
|
||||
<SelectGroup>
|
||||
{plans.map((p) => (
|
||||
<SelectItem key={p.plan.id} value={String(p.plan.id)}>
|
||||
{p.plan.title} ($
|
||||
{Number(p.plan.price_amount || 0).toFixed(2)})
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user