55 Card ,
66 ActionRow ,
77 Pagination ,
8- Alert ,
98 Icon ,
109} from '@openedx/paragon' ;
1110
@@ -18,7 +17,7 @@ import {
1817 type PaginationState ,
1918} from '@tanstack/react-table' ;
2019
21- import { ArrowDropUpDown , Info } from '@openedx/paragon/icons' ;
20+ import { ArrowDropUpDown } from '@openedx/paragon/icons' ;
2221import { useIntl } from '@edx/frontend-platform/i18n' ;
2322import TableBody from './TableBody' ;
2423import './TableView.scss' ;
@@ -30,6 +29,7 @@ import type {
3029 TreeRowData ,
3130} from './types' ;
3231import messages from './messages' ;
32+ import SaveErrorAlert from './SaveErrorAlert' ;
3333
3434interface TableViewProps {
3535 treeData : TreeRowData [ ] ;
@@ -102,18 +102,10 @@ const TableView = ({
102102
103103 const { isError } = createRowMutation ;
104104 const { isError : isUpdateError } = updateRowMutation ;
105- const [ showError , setShowError ] = React . useState ( true ) ;
106105
107106 return (
108107 < >
109- { ( isError || isUpdateError ) && showError && (
110- < Alert variant = "danger" icon = { Info } dismissible onClose = { ( ) => setShowError ( false ) } >
111- < Alert . Heading >
112- { intl . formatMessage ( messages . errorSavingTitle ) }
113- </ Alert . Heading >
114- { intl . formatMessage ( messages . errorSavingMessage , { errorMessage : draftError || intl . formatMessage ( messages . errorSavingMessage , { errorMessage : '' } ) } ) }
115- </ Alert >
116- ) }
108+ < SaveErrorAlert draftError = { draftError } isError = { isError } isUpdateError = { isUpdateError } />
117109 < Card className = "tag-list-card" >
118110 < Card . Section className = "p-0" >
119111 < div className = "d-flex justify-content-end align-items-center p-4" >
0 commit comments