(errors: string[])
| 88 | } |
| 89 | |
| 90 | function showValidationErrors(errors: string[]) { |
| 91 | if (errors.length === 0) return |
| 92 | |
| 93 | if (errors.length === 1) { |
| 94 | showErrorToast( |
| 95 | <span className="text-muted-foreground">{errors[0]}</span>, |
| 96 | ) |
| 97 | } else { |
| 98 | showErrorToast( |
| 99 | <div className="flex flex-col gap-1"> |
| 100 | <span className="font-medium"> |
| 101 | {errors.length} files rejected: |
| 102 | </span> |
| 103 | <ul className="text-muted-foreground text-xs list-disc list-inside"> |
| 104 | {errors.slice(0, 3).map((err) => ( |
| 105 | <li key={err}>{err}</li> |
| 106 | ))} |
| 107 | {errors.length > 3 && ( |
| 108 | <li>...and {errors.length - 3} more</li> |
| 109 | )} |
| 110 | </ul> |
| 111 | </div>, |
| 112 | ) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | interface ChatInputProps { |
| 117 | input: string |
no test coverage detected