From a01da7506cb0096f84d581790bc6c3d415368188 Mon Sep 17 00:00:00 2001 From: spivakov83 Date: Wed, 1 Oct 2025 09:40:58 +0300 Subject: [PATCH] feat: Update filter placeholder to provide example input based on default answer --- hooks/use-answer-filter.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hooks/use-answer-filter.ts b/hooks/use-answer-filter.ts index 846f4f1..b69aa79 100644 --- a/hooks/use-answer-filter.ts +++ b/hooks/use-answer-filter.ts @@ -69,5 +69,12 @@ export function buildFilterPlaceholder(question: WizardQuestion | null) { return "" } - return `Filter ${question.answers.length} options` + const defaultAnswer = question.answers.find((answer) => answer.isDefault && !answer.disabled) + const exampleLabel = defaultAnswer?.label?.trim() || defaultAnswer?.value?.trim() + + if (exampleLabel && exampleLabel.length > 0) { + return `Type ${exampleLabel} for example...` + } + + return "Type to filter options..." }