import React, { useState } from 'react'; import { Button, ConfirmModal } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { AccessControlAction, Organization } from 'app/types'; interface Props { orgs: Organization[]; onDelete: (orgId: number) => void; } export function AdminOrgsTable({ orgs, onDelete }: Props) { const canDeleteOrgs = contextSrv.hasPermission(AccessControlAction.OrgsDelete); const [deleteOrg, setDeleteOrg] = useState(); return ( {orgs.map((org) => ( ))} {deleteOrg && ( Are you sure you want to delete '{deleteOrg.name}'?
All dashboards for this organization will be removed! } confirmText="Delete" onDismiss={() => setDeleteOrg(undefined)} onConfirm={() => { onDelete(deleteOrg.id); setDeleteOrg(undefined); }} /> )}
ID Name
{org.id} {org.name}
); }