mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import Access from 'sentry/components/acl/access';
|
|
import type {ButtonProps} from 'sentry/components/button';
|
|
import {Button} from 'sentry/components/button';
|
|
import Confirm from 'sentry/components/confirm';
|
|
import {Tooltip} from 'sentry/components/tooltip';
|
|
import {IconDelete} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
|
|
interface DebugIdBundleDeleteButtonProps {
|
|
onDelete: () => void;
|
|
size?: ButtonProps['size'];
|
|
}
|
|
|
|
export function DebugIdBundleDeleteButton({
|
|
onDelete,
|
|
size = 'xs',
|
|
}: DebugIdBundleDeleteButtonProps) {
|
|
return (
|
|
<Access access={['project:releases']}>
|
|
{({hasAccess}) => (
|
|
<Tooltip
|
|
disabled={hasAccess}
|
|
title={t('You do not have permission to delete bundles.')}
|
|
>
|
|
<Confirm
|
|
onConfirm={onDelete}
|
|
message={t('Are you sure you want to delete this bundle?')}
|
|
disabled={!hasAccess}
|
|
>
|
|
<Button icon={<IconDelete size="xs" />} size={size} disabled={!hasAccess}>
|
|
{t('Delete Bundle')}
|
|
</Button>
|
|
</Confirm>
|
|
</Tooltip>
|
|
)}
|
|
</Access>
|
|
);
|
|
}
|