error-message.tsx 840 B

12345678910111213141516171819202122232425262728293031
  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, 'border-t border-gray-200 bg-[#FFFAEB] px-4 py-2')}>
  18. <div className='flex h-5 items-center'>
  19. <AlertTriangle className='mr-2 h-4 w-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 text-xs font-normal leading-[18px] text-gray-700'>{errorMsg}</div>
  24. )}
  25. </div>
  26. )
  27. }
  28. export default React.memo(ErrorMessage)