puerto 0.18.0

Puerto — Rust full-stack DDD framework CLI. Scaffolds Clean Architecture projects with auto-wired DI, SQLx support, and zero manual wiring. Formerly puerto-framework.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * The message under an input, when the API's error is about that field (`problem.field`). Placed
 * after the input's `<label>`, not in it: inside, it would become part of the input's name.
 */
export function FieldError({
  problem,
  field,
}: {
  problem: { field: string | null; text: string } | null;
  field: string;
}) {
  if (problem?.field !== field) return null;
  return <span className="text-error text-sm">{problem.text}</span>;
}