import fs from 'fs';
import path from 'path';

export function loadFileSystemContent(locale: string, slug: string) {
  const filePath = path.join(process.cwd(), 'src/content/legal', locale, `${slug}.md`);

  if (!fs.existsSync(filePath)) {
    throw new Error(`Content not found: ${filePath}`);
  }

  return fs.readFileSync(filePath, 'utf8');
}
