layout.tsx 690 B

123456789101112131415161718192021222324
  1. import { Row, Alert } from 'react-bootstrap'
  2. import Icon from '../../../../../shared/components/icon'
  3. import { UseAsyncReturnType } from '../../../../../shared/hooks/use-async'
  4. type LayoutProps = {
  5. children: React.ReactNode
  6. isError: UseAsyncReturnType['isError']
  7. error: UseAsyncReturnType['error']
  8. }
  9. function Layout({ isError, error, children }: LayoutProps) {
  10. return (
  11. <div className="affiliations-table-row--highlighted">
  12. <Row>{children}</Row>
  13. {isError && (
  14. <Alert bsStyle="danger" className="text-center">
  15. <Icon type="exclamation-triangle" fw /> {error.getUserFacingMessage()}
  16. </Alert>
  17. )}
  18. </div>
  19. )
  20. }
  21. export default Layout