Add repo removal confirmation alert component
This commit is contained in:
parent
d8b0d5971a
commit
baca849042
1 changed files with 37 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
import { Design } from '@revenge-mod/discord/design'
|
||||
import type { Repo } from '@revenge-mod/plugins/_/repositories'
|
||||
|
||||
const { AlertModal, AlertActionButton, Text } = Design
|
||||
|
||||
export default function RepoRemoveConfirmationAlert({
|
||||
repo,
|
||||
action,
|
||||
}: {
|
||||
repo: Repo
|
||||
action: () => Promise<void> | void
|
||||
}) {
|
||||
return (
|
||||
<AlertModal
|
||||
title="Remove repository?"
|
||||
content={
|
||||
<Text color="text-default">
|
||||
<Text variant="text-md/semibold" color="text-default">
|
||||
{repo.name ?? repo.url}
|
||||
</Text>{' '}
|
||||
will be removed. You can restore the default repositories by
|
||||
clearing Plugin Settings data.
|
||||
</Text>
|
||||
}
|
||||
actions={
|
||||
<>
|
||||
<AlertActionButton
|
||||
onPress={action}
|
||||
text="Remove"
|
||||
variant="destructive"
|
||||
/>
|
||||
<AlertActionButton text="Cancel" variant="secondary" />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue