<template>
  <view class="share-action-bar">
    <view
      v-for="action in actions"
      :key="action.key"
      class="action-item"
      @tap="$emit('pick', action.key)"
    >
      <image class="action-icon" :src="action.icon" mode="aspectFit" />
      <text class="action-label">{{ action.label }}</text>
    </view>
  </view>
</template>

<script setup>
const actions = [
  { key: 'weixin_friend', label: '微信', icon: '/static/assetDetail/share/ic_wechat_friend.png' },
  { key: 'weixin_moment', label: '朋友圈',   icon: '/static/assetDetail/share/ic_wechat_moment.png' },
  { key: 'qq',            label: 'QQ',       icon: '/static/assetDetail/share/ic_qq.png' },
  { key: 'qq_zone',       label: 'QQ空间',   icon: '/static/assetDetail/share/ic_qq_zone.png' },
  { key: 'sinaweibo',     label: '微博',     icon: '/static/assetDetail/share/ic_weibo.png' },
  { key: 'save_image',    label: '保存图片', icon: '/static/assetDetail/share/ic_save_image.png' }
];
defineEmits(['pick']);
</script>

<style lang="scss" scoped>
.share-action-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 24rpx 16rpx;
}
.action-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8rpx;
}
.action-icon  { width: 80rpx; height: 80rpx; }
.action-label { font-size: 24rpx; color: #333; }
</style>
