dhre-ui-kit 0.0.388 → 0.0.389

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/lib/index.mjs CHANGED
@@ -3710,7 +3710,7 @@ const styles$l = StyleSheet.create({
3710
3710
  });
3711
3711
 
3712
3712
  const Toast = React.forwardRef(
3713
- ({ sucessIcon, errorIcon, warningIcon }, ref) => {
3713
+ ({ sucessIcon, errorIcon, warningIcon, language }, ref) => {
3714
3714
  const [visible, setVisible] = useState(false);
3715
3715
  const [message, setMessage] = useState("");
3716
3716
  const [isSuccess, setIsSuccess] = useState(true);
@@ -3770,13 +3770,17 @@ const Toast = React.forwardRef(
3770
3770
  useEffect(() => {
3771
3771
  const translateText = async () => {
3772
3772
  try {
3773
- const res = await translate(message, { to: "ar" });
3773
+ const res = await translate(message, { to: language });
3774
3774
  setTranslatedText(res?.text);
3775
3775
  } catch (error) {
3776
3776
  setTranslatedText(message);
3777
3777
  }
3778
3778
  };
3779
- translateText();
3779
+ if (language === "en") {
3780
+ setTranslatedText(message);
3781
+ } else {
3782
+ translateText();
3783
+ }
3780
3784
  }, [message]);
3781
3785
  return visible && translatedText?.length ? /* @__PURE__ */ React.createElement(
3782
3786
  Animated.View,