// Corpus page constants

export const CORPUS_FETCH_LIMIT = 100;
export const DEFAULT_MIN_PROJECTS = 1;

// Re-export shared formatters for convenience
export { formatRelativeTime, formatUnixTimestamp } from "@/lib/format";

// Subject path parsing
export function extractDomain(subject: string): string {
  // Extract domain from code://rust/*/tls → rust
  const match = subject.match(/^code:\/\/([^/]+)/);
  return match ? match[1] : "unknown";
}

export function extractConcept(subject: string): string {
  // Extract last part of path: code://rust/*/tls/cert → cert
  const parts = subject.split("/");
  return parts[parts.length - 1] || subject;
}
