OrganizationDeletePanel.tsx30 lines · main
| 1 | import { Admonition } from 'ui-patterns' |
| 2 | |
| 3 | import { DeleteOrganizationButton } from './DeleteOrganizationButton' |
| 4 | import PartnerManagedResource from '@/components/ui/PartnerManagedResource' |
| 5 | import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization' |
| 6 | import { MANAGED_BY } from '@/lib/constants/infrastructure' |
| 7 | |
| 8 | export const OrganizationDeletePanel = () => { |
| 9 | const { data: selectedOrganization } = useSelectedOrganizationQuery() |
| 10 | |
| 11 | return selectedOrganization?.managed_by !== 'vercel-marketplace' ? ( |
| 12 | <Admonition |
| 13 | type="destructive" |
| 14 | title="Deleting this organization will also remove its projects" |
| 15 | description="Make sure you have made a backup of your projects if you want to keep your data" |
| 16 | > |
| 17 | <DeleteOrganizationButton /> |
| 18 | </Admonition> |
| 19 | ) : ( |
| 20 | <PartnerManagedResource |
| 21 | managedBy={MANAGED_BY.VERCEL_MARKETPLACE} |
| 22 | resource="Organizations" |
| 23 | cta={{ |
| 24 | installationId: selectedOrganization?.partner_id, |
| 25 | path: '/settings', |
| 26 | message: 'Delete organization in Vercel Marketplace', |
| 27 | }} |
| 28 | /> |
| 29 | ) |
| 30 | } |