'use client' import { Organization } from '~/data/organizations' import { Check, ChevronsUpDown, Plus } from 'lucide-react' import Link from 'next/link' import { useState } from 'react' import { PlanId } from 'shared-data/plans' import { Button, ButtonProps, cn, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogSection, DialogTitle, DialogTrigger, Popover, PopoverContent, PopoverTrigger, } from 'ui' interface UpgradePlanProps { organizations?: Organization[] onClick?: () => void size?: ButtonProps['size'] planId: PlanId } const UpgradePlan = ({ organizations = [], onClick, size = 'large', planId }: UpgradePlanProps) => { const [open, setOpen] = useState(false) const [value, setValue] = useState('') return ( Upgrade organization Choose the organization you want to upgrade to a paid plan. No organizations found. {organizations.map((organization) => ( { setValue(currentValue === value ? '' : currentValue) setOpen(false) }} keywords={[organization.name]} > {organization.name} ))} { setValue(currentValue === value ? '' : currentValue) setOpen(false) }} keywords={['Create a new organization']} > Create a new organization Upon continuing, you will be redirected to the organization's billing page where you can upgrade to a paid plan. ) } export default UpgradePlan