error-message.tsx 840 B

123456789101112131415161718192021222324252627282930
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import cn from '@/utils/classnames'
  5. import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
  6. type Props = {
  7. className?: string
  8. title: string
  9. errorMsg?: string
  10. }
  11. const ErrorMessage: FC<Props> = ({
  12. className,
  13. title,
  14. errorMsg,
  15. }) => {
  16. return (
  17. <div className={cn(className, 'py-2 px-4 border-t border-gray-200 bg-[#FFFAEB]')}>
  18. <div className='flex items-center h-5'>
  19. <AlertTriangle className='mr-2 w-4 h-4 text-[#F79009]' />
  20. <div className='text-sm font-medium text-[#DC6803]'>{title}</div>
  21. </div>
  22. {errorMsg && (
  23. <div className='mt-1 pl-6 leading-[18px] text-xs font-normal text-gray-700'>{errorMsg}</div>
  24. )}
  25. </div>
  26. )
  27. }
  28. export default React.memo(ErrorMessage)