/*
 * @Author: wjc
 * @Date: 2025-04-09 10:19:11
 * @LastEditors: wjc
 * @LastEditTime: 2026-01-16 14:28:48
 * @Description:
 */
export function useSafeAreaInsetTop() {
  const safeAreaInsetTop = ref(0)

  const sysInfo = uni.getSystemInfoSync()
  // #ifndef MP
  safeAreaInsetTop.value = sysInfo.statusBarHeight
  safeAreaInsetTop.value =
    sysInfo.platform === 'android' ? sysInfo.statusBarHeight + 50 : sysInfo.statusBarHeight + 45
  // #endif

  // #ifdef MP-WEIXIN
  const custom = wx.getMenuButtonBoundingClientRect()
  safeAreaInsetTop.value = custom.bottom + custom.top - sysInfo.statusBarHeight
  // #endif

  // #ifdef MP-ALIPAY
  safeAreaInsetTop.value = sysInfo.statusBarHeight + sysInfo.titleBarHeight
  // #endif

  return {
    safeAreaInsetTop,
  }
}
