export function createMachineSessionLoadSummary(session) {
  return {
    iniOpfsPath: session?.ini?.opfsPath ?? null,
    iniWasmPath: session?.ini?.wasmPath ?? null,
    parameterOpfsPath: session?.parameters?.opfsPath ?? null,
    parameterWasmPath: session?.parameters?.wasmPath ?? null,
    parameterResult: session?.parameters?.result ?? "",
    toolTableOpfsPath: session?.toolTable?.opfsPath ?? null,
    toolTableWasmPath: session?.toolTable?.wasmPath ?? null,
    toolTableResult: session?.toolTable?.result ?? "",
  };
}

export function machineSessionLoadLogLines(summary) {
  return [
    `INI: ${summary.iniOpfsPath ?? "-"} -> ${summary.iniWasmPath ?? "-"}`,
    `Parameter file: ${summary.parameterOpfsPath ?? "-"} -> ${summary.parameterWasmPath ?? "-"}`,
    `Parameters: ${summary.parameterResult.trim()}`,
    `Tool table file: ${summary.toolTableOpfsPath ?? "-"} -> ${summary.toolTableWasmPath ?? "-"}`,
    `Tool table: ${summary.toolTableResult.trim()}`,
  ];
}
