fix: add unique key prop to conversation starter list items (#619)

- Changed key from question text to combination of index and question text
- Ensures unique keys even if translation has duplicate questions
- Resolves React warning: 'Each child in a list should have a unique key prop'
This commit is contained in:
Willem Jiang
2025-10-16 18:07:12 +08:00
committed by Willem Jiang
parent 120fcfb316
commit 025ea6b94e

View File

@@ -26,7 +26,7 @@ export function ConversationStarter({
<ul className="flex flex-wrap">
{questions.map((question, index) => (
<motion.li
key={question}
key={`${index}-${question}`}
className="flex w-1/2 shrink-0 p-2 active:scale-105"
style={{ transition: "all 0.2s ease-out" }}
initial={{ opacity: 0, y: 24 }}