import { useState } from '#app';
import { DefaultChain } from '@/constants/UnifiedManagementChain';

const tokenName = 'token';
// 获取当前交易token
export const useCurToken = () => {
  return useState(tokenName, () => 'bar');
};

// 当前链
export const useChain = () => {
  return useState('chain', () => DefaultChain);
};

// 当前筛选条件
export const useCurFilter = () => {
  return useState('filterParams', () => ({
    pool_column: 'wb',
    nt: 0,
    range_date: '5m',
    date: '5m',
    rise_or_fall: 'up',
    page: 1,
    page_size: 100,
  }));
};
// 通知表格请求数据
export const useChangeTable = () => {
  return useState('filterChange', () => 1);
};

// 当前右侧的token和tb等数据
export const useCurrentRightInfo = () => {
  return useState('RightInfo', () => ({
    token: '',
    tb: '',
    r24h: '',
  }));
};

// 当前主题
export const useCurTheme = () => {
  return useState('theme', () => 'light');
};

// 预渲染的数据列表
export const UsePreRenderList = () => {
  return useState('preRenderList', () => ({
    list: [],
    total: 0,
  }));
};

// 用户钱包地址
export const useUserAddress = () => {
  return useState('walletAddress', () => '');
};

// 当前k线的价格
export const useCurrentKLinePrice = () => {
  return useState('CurrentKLinePrice', () => 0);
};
