import type { JWTPayload } from 'jose';

export * from './profile';
export * from './tag';
export interface Config {
  KAIQIUCC_TOKEN: string;
}
export interface IEventInfo {
  title: string;
  info: string[];
  url: string;
  matchId: string;
  startDate: string;
  isFinished: boolean;
  isProcessing: boolean;
  location: string;
}

export interface MatchInfo {
  itemId: string;
  title: string;
  players: Player[];
}

export interface BasePlayer {
  uid: string;
  name: string;
  score: string;
}

export interface Player extends BasePlayer {
  avatar: string;
  info: string;
}

export interface XCXMember extends BasePlayer {
  uid: string;
  score: string;
  realname: string;
  name: string;
  number: number;
  age: string;
}

export interface XCXFindUser extends BasePlayer {
  name: never;
  username2: string;
  realname: string;
  residecity: string;
  resideprovince: string;
  minscore: string;
  maxscore: string;
  birthyear: string;
  sex: string;
  th?: string;
}

export interface XCXFindUserResp {
  current_page: number;
  last_page: number;
  per_page: number;
  total: number;
  data: XCXFindUser[];
}

export interface ClubInfo {
  id: string;
  name: string;
  members: number;
  area: string;
  url: string;
  img: string;
}

export interface ClubDetail {
  id: string;
  name: string;
  article: string;
  img: string;
  geo: { lng: number; lat: number; } | null;
}

export interface EventDetail {
  itemId: string,
  eventId: string,
  title: string,
  players: Player[],
}

export type WsPaylaod = {
  user: Required<JWTPayload>;
}

export type NotificationData = {
  title: string;
  body?: string;
  icon?: string;
  url?: string;
}