• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vintasoftware / nextjs-fastapi-template / 16178804135

09 Jul 2025 07:45PM UTC coverage: 98.372%. Remained the same
16178804135

push

github

web-flow
Merge pull request #90 from vintasoftware/release-0.0.4

Release 0.0.4

91 of 98 branches covered (92.86%)

Branch coverage included in aggregate %.

1480 of 1499 relevant lines covered (98.73%)

8.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.43
/nextjs-frontend/components/ui/FormError.tsx
1
interface ErrorState {
2✔
2
  errors?: {
2✔
3
    [key: string]: string | string[];
2✔
4
  };
2✔
5
  server_validation_error?: string;
2✔
6
  server_error?: string;
2✔
7
}
2✔
8

2✔
9
interface FormErrorProps {
2✔
10
  state?: ErrorState;
2✔
11
  className?: string;
2✔
12
}
2✔
13

2✔
14
export function FormError({ state, className = "" }: FormErrorProps) {
2✔
15
  if (!state) return null;
62✔
16

18✔
17
  const error = state.server_validation_error || state.server_error;
62✔
18
  if (!error) return null;
62✔
19

10✔
20
  return <p className={`text-sm text-red-500 ${className}`}>{error}</p>;
10✔
21
}
10✔
22

2✔
23
interface FieldErrorProps {
2✔
24
  state?: ErrorState;
2✔
25
  field: string;
2✔
26
  className?: string;
2✔
27
}
2✔
28

2✔
29
export function FieldError({ state, field, className = "" }: FieldErrorProps) {
2✔
30
  if (!state?.errors) return null;
124✔
31

8✔
32
  const error = state.errors[field];
8✔
33
  if (!error) return null;
84!
34

8✔
35
  if (Array.isArray(error)) {
8✔
36
    return (
8✔
37
      <div className={`text-sm text-red-500 ${className}`}>
8✔
38
        <ul className="list-disc ml-4">
8✔
39
          {error.map((err) => (
8✔
40
            <li key={err}>{err}</li>
8✔
41
          ))}
8✔
42
        </ul>
8✔
43
      </div>
8✔
44
    );
8✔
45
  }
8!
46

×
47
  return <p className={`text-sm text-red-500 ${className}`}>{error}</p>;
×
48
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc