fix message

This commit is contained in:
Jonathan Summers-Muir committed 2024-11-01 18:08:18 +08:00
1 parent 26544ac0e4
commit bd162f4635
2 files changed
+16 -8

No files matched your search

@@ -219,6 +219,7 @@ export function DiskManagementForm() {
const onSubmit = async (data: DiskStorageSchemaType) => {
let payload = data
setMessageState(null)
try {
if (
payload.storageType !== form.formState.defaultValues?.storageType ||
@@ -21,6 +21,7 @@ import {
DialogDescription,
DialogFooter,
DialogHeader,
DialogSection,
DialogSectionSeparator,
DialogTitle,
DialogTrigger,
@@ -333,7 +334,6 @@ export const DiskManagementReviewAndSubmitDialog = ({
<Button block size="large" type="default" onClick={() => setIsDialogOpen(false)}>
Cancel
</Button>
<Button
block
type={'warning'}
@@ -346,14 +346,21 @@ export const DiskManagementReviewAndSubmitDialog = ({
>
Confirm changes
</Button>
{message && (
<Alert_Shadcn_ variant={message.type === 'error' ? 'destructive' : 'default'}>
<WarningIcon />
<AlertTitle_Shadcn_>{message.message}</AlertTitle_Shadcn_>
</Alert_Shadcn_>
)}
</DialogFooter>
{message && (
<>
<DialogSectionSeparator />
<DialogSection>
<Alert_Shadcn_
variant={message.type === 'error' ? 'destructive' : 'default'}
className=""
>
<WarningIcon />
<AlertTitle_Shadcn_>{message.message}</AlertTitle_Shadcn_>
</Alert_Shadcn_>
</DialogSection>
</>
)}
</DialogContent>
</Dialog>
)