ds-notification.tsx 676 B

12345678910111213141516171819202122232425262728
  1. import Notification, {
  2. NotificationProps,
  3. } from '@/shared/components/notification'
  4. import classNames from 'classnames'
  5. import { WarningCircle, Info } from '@phosphor-icons/react'
  6. type DSNotificationProps = Pick<
  7. NotificationProps,
  8. 'content' | 'customIcon' | 'className'
  9. > & {
  10. type: 'info' | 'error'
  11. }
  12. function DSNotification(props: DSNotificationProps) {
  13. const { type, className, ...rest } = props
  14. const customIcon = type === 'info' ? <Info /> : <WarningCircle />
  15. return (
  16. <Notification
  17. type={type}
  18. customIcon={customIcon}
  19. className={classNames('notification-ds', className)}
  20. {...rest}
  21. />
  22. )
  23. }
  24. export default DSNotification