import {z} from 'zod';
import { useApi } from '@common/api/useApi.ts';

const imInfoSchema = z.object({
  account: z.string().min(1),
  userSig: z.string().min(1),
});

// 获取腾讯im账号
// {"account": "fbf2ea4fcbeb4c5da305faa76d2e1b70"}
const useImSign = () => {
  return useApi(
    '/am/v4/userCenter/getImSign',
    'POSTJSON',
    {
      pushSwitch: '1',
    },
    imInfoSchema,
    {
      loadingDelay: 500,
    },
  );
};

export {useImSign};
