|
1 | 1 | "use client"
|
2 | 2 |
|
3 | 3 | import React, { useState } from "react"
|
4 |
| -import { HeartHandshake } from "lucide-react" |
| 4 | +import { HeartHandshake, TriangleAlert } from "lucide-react" |
5 | 5 |
|
6 | 6 | import { Button } from "@/components/ui/buttons/Button"
|
7 | 7 | import Input from "@/components/ui/input"
|
@@ -91,9 +91,9 @@ const sanitizeInput = (input: string): string =>
|
91 | 91 | const EnterpriseContactForm = ({ strings }: EnterpriseContactFormProps) => {
|
92 | 92 | const getCharacterCountClasses = (currentLength: number, maxLength: number) =>
|
93 | 93 | cn(
|
94 |
| - currentLength >= Math.floor(maxLength * 0.9) && "block", // Show char count when within 10% remaining to limit |
| 94 | + currentLength >= Math.floor(maxLength * 0.9) && "flex", // Show char count when within 10% remaining to limit |
95 | 95 | currentLength > maxLength - 64 && "text-warning-border", // Warning color within 64 chars (border version for proper contrast ratio),
|
96 |
| - currentLength > maxLength && "text-error" // Error color over limit |
| 96 | + currentLength > maxLength && "text-error [&_svg]:inline" // Error color over limit |
97 | 97 | )
|
98 | 98 |
|
99 | 99 | const [formData, setFormData] = useState<FormState>({
|
@@ -250,13 +250,14 @@ const EnterpriseContactForm = ({ strings }: EnterpriseContactFormProps) => {
|
250 | 250 | />
|
251 | 251 | <div
|
252 | 252 | className={cn(
|
253 |
| - "absolute bottom-1 end-3 hidden rounded bg-background px-1 py-0.5 text-xs shadow", |
| 253 | + "absolute bottom-1 end-3 hidden items-center rounded bg-background px-1 py-0.5 text-xs shadow", |
254 | 254 | getCharacterCountClasses(
|
255 | 255 | formData.message.length,
|
256 | 256 | MAX_MESSAGE_LENGTH
|
257 | 257 | )
|
258 | 258 | )}
|
259 | 259 | >
|
| 260 | + <TriangleAlert className="mb-px me-1 hidden size-3" /> |
260 | 261 | {formData.message.length}/{MAX_MESSAGE_LENGTH}
|
261 | 262 | </div>
|
262 | 263 | </div>
|
|
0 commit comments