// src/features/review/domain/presentation.ts
function truncateCommitSubject(subject) {
  if (subject.length <= 72) {
    return subject;
  }
  return `${subject.slice(0, 69)}...`;
}
function formatReviewTargetFileCount(fileCount) {
  return fileCount === 0 ? "\uBCC0\uACBD \uC5C6\uC74C" : `${fileCount}\uAC1C \uD30C\uC77C`;
}

// src/features/review/domain/targets.ts
function createWorkingTreeReviewOption(kind, fileCount) {
  const subject = kind === "unstaged" ? "\uC544\uC9C1 git add \uD558\uC9C0 \uC54A\uC740 \uBCC0\uACBD\uC0AC\uD56D" : "git add \uB41C \uBCC0\uACBD\uC0AC\uD56D";
  return {
    author: "",
    hash: kind,
    kind,
    label: kind,
    relativeDate: "",
    subject: `${subject} | ${formatReviewTargetFileCount(fileCount)}`
  };
}
function parseRecentCommitOptions(output) {
  if (!output) {
    return [];
  }
  return output.split("\n").map((line) => {
    const [hash = "", author = "", relativeDate = "", ...subjectParts] = line.split("	");
    const subject = subjectParts.join("	").trim();
    return {
      author,
      hash,
      kind: "commit",
      label: `${hash} | ${truncateCommitSubject(subject)}`,
      relativeDate,
      subject
    };
  });
}

export { createWorkingTreeReviewOption, parseRecentCommitOptions };
