Custom Alert messages
The useAlerts()
hook is used to manage alerts within the application, allowing you to add and manipulate custom notifications.
Success
import { useAlerts } from "**/sdk/react";
const { addAlert } = useAlerts();
addAlert({
title: "Success!",
description: "Your action was completed successfully.",
type: "success",
timeout: 3000
});
Error
addAlert({
title: "An error occurred",
description: "An unexpected error occurred. Please try again.",
type: "error",
timeout: 3000
});
Warning
addAlert({
title: "Warning!",
description: "Be careful with this action.",
type: "warn",
timeout: 3000
});
Information
addAlert({
title: "Information",
description: "Here is some relevant information.",
type: "info",
timeout: 3000
});
Updated about 15 hours ago