export function createMachineFileSaveSummary(paths, gcodePath = null) {
  return {
    iniOpfsPath: paths?.ini ?? null,
    toolTableOpfsPath: paths?.toolTable ?? null,
    parameterOpfsPath: paths?.parameters ?? null,
    gcodeOpfsPath: gcodePath ?? null,
  };
}

export function machineFileSaveLogLines(summary) {
  return [
    `INI: ${summary.iniOpfsPath ?? "-"}`,
    `Tool table: ${summary.toolTableOpfsPath ?? "-"}`,
    `Parameters: ${summary.parameterOpfsPath ?? "-"}`,
    `G-code: ${summary.gcodeOpfsPath ?? "-"}`,
  ];
}

export function createMachineFileLoadSummary(files) {
  return {
    iniBytes: files?.ini?.length ?? 0,
    toolTableBytes: files?.toolTable?.length ?? 0,
    parameterBytes: files?.parameters?.length ?? 0,
  };
}

export function machineFileLoadLogLines(summary) {
  return [
    `INI bytes: ${summary.iniBytes}`,
    `Tool table bytes: ${summary.toolTableBytes}`,
    `Parameter bytes: ${summary.parameterBytes}`,
  ];
}
