{"version":3,"file":"NotificationRenderController.mjs","names":[],"sources":["../../../src/components/NotificationRenderController.tsx"],"sourcesContent":["import {\n  useNotificationController,\n  type NotificationProps,\n  Notification,\n} from \"@mittwald/flow-react-components\";\nimport { useEffect, useRef, type FC } from \"react\";\n\nexport const NotificationRenderController: FC<NotificationProps> = (props) => {\n  const notifications = useNotificationController();\n  const isAdded = useRef(false);\n\n  useEffect(() => {\n    if (isAdded.current) {\n      return;\n    }\n\n    const id = notifications.add(<Notification {...props} />);\n    isAdded.current = true;\n\n    return () => {\n      notifications.remove(id);\n      isAdded.current = false;\n    };\n  }, [notifications]);\n\n  return null;\n};\n"],"mappings":";;;;;;AAOA,IAAa,gCAAuD,UAAU;CAC5E,MAAM,gBAAgB,0BAA0B;CAChD,MAAM,UAAU,OAAO,KAAK;CAE5B,gBAAgB;EACd,IAAI,QAAQ,SACV;EAGF,MAAM,KAAK,cAAc,IAAI,oBAAC,cAAD,EAAc,GAAI,MAAQ,CAAA,CAAC;EACxD,QAAQ,UAAU;EAElB,aAAa;GACX,cAAc,OAAO,EAAE;GACvB,QAAQ,UAAU;EACpB;CACF,GAAG,CAAC,aAAa,CAAC;CAElB,OAAO;AACT"}