@rolster/react-components 18.17.2 → 18.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.js CHANGED
@@ -1992,28 +1992,30 @@ function useConfirmationService() {
1992
1992
  const [config, setConfig] = useState({});
1993
1993
  const [visible, setVisible] = useState(false);
1994
1994
  const rlsConfirmation = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
1995
- function confirmation(config) {
1995
+ function confirmation(options) {
1996
1996
  return new Promise((resolve) => {
1997
- const { content, rlsTheme, subtitle, title, approved, reject } = config;
1997
+ const { content, rlsTheme, subtitle, title, approved, reject } = options;
1998
1998
  setConfig({
1999
1999
  content,
2000
2000
  rlsTheme,
2001
2001
  subtitle,
2002
2002
  title,
2003
2003
  approved: {
2004
- label: approved || reactI18n('confirmationActionApproved'),
2004
+ label: approved?.label ?? reactI18n('confirmationActionApproved'),
2005
2005
  onClick: () => {
2006
2006
  setVisible(false);
2007
2007
  resolve(ConfirmationResult.approved());
2008
- }
2008
+ },
2009
+ identifier: approved?.identifier
2009
2010
  },
2010
2011
  reject: reject
2011
2012
  ? {
2012
- label: reject,
2013
+ label: reject.label,
2013
2014
  onClick: () => {
2014
2015
  setVisible(false);
2015
2016
  resolve(ConfirmationResult.reject());
2016
- }
2017
+ },
2018
+ identifier: reject.identifier
2017
2019
  }
2018
2020
  : undefined
2019
2021
  });