import { BaseResponsiveProps } from "../../../responsive/type.js";

//#region src/plus/saasDevice/appDevicePlanning/types.d.ts
type DeviceKind = 'smart' | 'dumb' | 'integrated';
type DeviceLinkStatus = 'linked' | 'unlinked' | string;
type DeviceOnlineStatus = 'online' | 'offline' | 'unknown' | string;
type I18nText = string | {
  original?: string;
  'zh-CN'?: string;
  'zh-HK'?: string;
  en?: string;
  ja?: string;
  pt?: string;
  [key: string]: any;
};
interface SaasAppDevicePlanningProps extends BaseResponsiveProps {
  kind?: DeviceKind;
  typeCode?: string;
  modelCode?: string;
  showBack?: boolean;
  onBack?: () => void;
  onLinked?: (params: DeviceLinkedParams) => void | Promise<void>;
}
interface DeviceLinkedParams {
  device: DeviceItem | null;
  channel: string;
}
interface WorkAreaItem {
  id: number;
  tenant_id?: number;
  name: I18nText;
  description?: I18nText;
  sort: number;
  created_at?: string;
  updated_at?: string;
}
interface DeviceTypeItem {
  id: number;
  kind: DeviceKind;
  code: string;
  icon?: string | null;
  name: I18nText;
  description?: I18nText;
  status?: string;
  sort?: number;
  active_models?: DeviceModelItem[];
}
interface DeviceModelItem {
  id: number;
  brand_code?: string;
  type_code: string;
  code: string;
  name: I18nText;
  description?: I18nText;
  data?: {
    profile_structure?: {
      required?: boolean;
      tabs?: unknown[];
    };
    [key: string]: unknown;
  } | null;
  status?: string;
  sort?: number;
  active_profiles?: DeviceProfileItem[];
  type?: DeviceTypeItem;
  brand?: {
    code?: string;
    name?: I18nText;
    [key: string]: unknown;
  };
}
interface DeviceProfileItem {
  id: number;
  model_code?: string;
  template_code?: string;
  name?: I18nText;
  description?: I18nText;
  setting?: Record<string, unknown> | null;
  status?: string;
}
interface DeviceItem {
  id: number;
  tenant_id?: number;
  workarea_id?: number;
  type_kind: DeviceKind;
  type_code: string;
  model_code: string;
  profile_id?: number | null;
  number?: string;
  name: I18nText;
  data?: Record<string, unknown> | null;
  setting?: Record<string, unknown> | null;
  link?: DeviceLinkStatus;
  status?: DeviceOnlineStatus;
  sort?: number;
  last_seen?: string;
  created_at?: string;
  updated_at?: string;
  type?: DeviceTypeItem;
  model?: DeviceModelItem;
  profile?: DeviceProfileItem | null;
  workarea?: WorkAreaItem;
}
//#endregion
export { SaasAppDevicePlanningProps };