useAutomation hook automates modal closing and toast notifications based on form response data.ts
import { useAutomation } from "@arkyn/components";
formResponseData (required)anyvoidtsx
import { useAutomation } from "@arkyn/components";function SubmitFeedback({ responseData }: { responseData: any }) {useAutomation(responseData);return null;}// Example response dataconst responseData = {closeModal: true,message: "Operation completed successfully!",type: "success",};
closeModal is truthy, the hook calls closeAll() from useModal().message is present, it decides toast style using type, badResponses, and successResponses.useModal and useToast.