import type { IAccessor, ICommand } from '@univerjs/core';

import { CommandType } from '@univerjs/core';

import { JnpfSheetsExcelFileService } from '../../services/sheet-excel-file.service';
import { JnpfCommandIds } from '../../utils/define';

export const JnpfSheetsImportExcelFileOperation: ICommand = {
  handler: async (_: IAccessor) => {
    return true;
  },
  id: JnpfCommandIds.importExcelFile,
  type: CommandType.OPERATION,
};

export const JnpfSheetsDownloadExcelFileOperation: ICommand = {
  handler: async (_: IAccessor) => {
    return true;
  },
  id: JnpfCommandIds.downloadExcelFile,
  type: CommandType.OPERATION,
};

export const JnpfSheetsImportCsvFileOperation: ICommand = {
  handler: async (accessor: IAccessor) => {
    const jnpfSheetsExcelFileService = accessor.get(JnpfSheetsExcelFileService);
    jnpfSheetsExcelFileService?.handleImportCsv();

    return true;
  },
  id: JnpfCommandIds.importCsvFile,
  type: CommandType.OPERATION,
};
