Унификация отображения ошибок: LoadingError для загрузки, Toast для действий
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 34s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 34s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import './Toast.css'
|
||||
|
||||
function Toast({ message, onClose, duration = 3000 }) {
|
||||
function Toast({ message, onClose, duration = 3000, type = 'success' }) {
|
||||
const [isVisible, setIsVisible] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -18,7 +18,7 @@ function Toast({ message, onClose, duration = 3000 }) {
|
||||
if (!isVisible) return null
|
||||
|
||||
return (
|
||||
<div className={`toast ${isVisible ? 'toast-visible' : ''}`}>
|
||||
<div className={`toast toast-${type} ${isVisible ? 'toast-visible' : ''}`}>
|
||||
<div className="toast-content">
|
||||
<span className="toast-message">{message}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user