Update API client and feedback form components

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ravi Gulhane 2026-07-08 13:57:56 +05:30
parent 0419adeba6
commit 71225cf2b0
3 changed files with 21 additions and 1 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
node_modules
dist
.vite
.DS_Store
*.local
# Env (keep .env.example)
.env
.env.*
!.env.example

View File

@ -110,7 +110,10 @@ export function DynamicFeedbackForm({
) : null} ) : null}
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
{fields.map((f) => ( {fields.map((f) => (
<FieldInput key={String(f.label)} f={f} value={values[String(f.label).trim()]} onChange={setVal} /> <div key={String(f.label)} className="flex flex-col">
<FieldInput f={f} value={values[String(f.label).trim()]} onChange={setVal} />
<FieldRemarks text={f.remarks} />
</div>
))} ))}
</div> </div>
{err ? <p className="mt-3 text-sm text-red-600">{err}</p> : null} {err ? <p className="mt-3 text-sm text-red-600">{err}</p> : null}
@ -130,6 +133,12 @@ function stripHtml(s: string): string {
return s.replace(/<[^>]*>/g, "").trim() || s; return s.replace(/<[^>]*>/g, "").trim() || s;
} }
function FieldRemarks({ text }: { text?: string }) {
const trimmed = text?.trim();
if (!trimmed) return null;
return <p className="mt-1.5 text-xs leading-snug text-[rgba(36,40,47,0.55)]">{trimmed}</p>;
}
function FieldInput({ function FieldInput({
f, f,
value, value,

View File

@ -257,6 +257,7 @@ export type VisitorPublicFeedbackFormField = {
required?: boolean; required?: boolean;
options?: string[]; options?: string[];
placeholder?: string; placeholder?: string;
remarks?: string;
}; };
export type VisitorPublicFeedbackForm = { export type VisitorPublicFeedbackForm = {