File tree Expand file tree Collapse file tree
packages/ui/src/mosaic/block Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ interface DestructiveProps {
1717 resourceName : string ;
1818 onDelete : ( ) => void | Promise < void > ;
1919 isDeleting : boolean ;
20+ error ?: string | null ;
2021}
2122
2223export function Destructive ( {
@@ -29,6 +30,7 @@ export function Destructive({
2930 resourceName,
3031 onDelete,
3132 isDeleting,
33+ error,
3234} : DestructiveProps ) {
3335 const [ confirmValue , setConfirmValue ] = useState ( '' ) ;
3436 const canSubmit = confirmValue === resourceName && ! isDeleting ;
@@ -52,6 +54,18 @@ export function Destructive({
5254 < >
5355 < Dialog . Title render = { p => < Heading { ...p } /> } > { title } </ Dialog . Title >
5456 < Dialog . Description render = { p => < Text { ...p } /> } > { description } </ Dialog . Description >
57+ { error && (
58+ < Box
59+ render = { p => < p { ...p } /> }
60+ sx = { t => ( {
61+ ...t . text ( 'sm' ) ,
62+ color : t . color . destructive ,
63+ marginBlockStart : t . spacing ( 2 ) ,
64+ } ) }
65+ >
66+ { error }
67+ </ Box >
68+ ) }
5569 < form onSubmit = { handleSubmit } >
5670 < Box
5771 render = { p => < label { ...p } /> }
You can’t perform that action at this time.
0 commit comments