import { Share } from 'react-native';
import { useBottomSheet } from '../../../core/stores/slices/bottomSheetSlice';
import { useAmityElement } from '../../hooks';
import { ComponentID, ElementID } from '../../enums';
import MenuAction from '../MenuAction/MenuAction';
import { share } from '../../../core/assets/icons';
export function ShareAction({
  link,
  pageId,
  componentId = ComponentID.WildCardComponent,
  onPress,
  dark
}) {
  const {
    closeBottomSheet
  } = useBottomSheet();
  const {
    config,
    isExcluded
  } = useAmityElement({
    pageId,
    componentId,
    elementId: ElementID.share_link
  });
  if (isExcluded) return null;
  return /*#__PURE__*/React.createElement(MenuAction, {
    gap: "small",
    dark: dark,
    iconProps: {
      xml: share()
    },
    label: (config === null || config === void 0 ? void 0 : config.text) ?? 'Share to',
    onPress: () => {
      onPress ? onPress() : closeBottomSheet();
      Share.share({
        message: link
      });
    }
  });
}
//# sourceMappingURL=ShareAction.js.map