[dotenv@17.2.3] injecting env (0) from .env -- tip:
Your task is to:
- Generate a props schema (formal parameter definitions) based on the first component instance
- Extract the data array (actual parameter values) for all component instances from the provided Figma structure data
Context:
- Container: CertoLandingPage
- Child Component: InsightCard
- Figma Data: [ { "id": "728:17958", "name": "a", "type": "IMAGE", "url": "@/assets/a-728-17958.png", "absoluteBoundingBox": { "x": 23292, "y": 23346.984375, "width": 320, "height": 534 }, "inlineStyles": { "borderRadius": "48px" } }, { "id": "728:17972", "name": "a", "type": "IMAGE", "url": "@/assets/a-728-17972.png", "absoluteBoundingBox": { "x": 23660, "y": 23346.984375, "width": 320, "height": 534 }, "inlineStyles": { "borderRadius": "48px" } }, { "id": "728:17965", "name": "a", "type": "IMAGE", "url": "@/assets/a-728-17965.png", "absoluteBoundingBox": { "x": 24028, "y": 23346.984375, "width": 320, "height": 534 }, "inlineStyles": { "borderRadius": "48px" } } ]
Instructions:
- Analyze the "children" in the Figma Data. Identify those that are instances of "InsightCard".
- For each instance, extract ALL differing content, including:
- Text: Extract the EXACT text content found in the "characters" fields. Do NOT summarize or generate placeholders.
-
Images/Icons: Identify nodes where
typeis "IMAGE". These nodes will have aurlfield.- If a node has
isIcon: truefield, or the node name contains "icon", or the url ends with ".svg", useiconSrcas the key. - Otherwise, use
imageSrcoravatarSrcbased on context (e.g., avatar for profile pictures).
- If a node has
-
Layout/Variants:
- If the component has
layoutDirection: "HORIZONTAL"in the layoutInfo, and contains both text and image content, determine the image position: - Check the
absoluteBoundingBoxpositions: if image's x position is less than text's x position, image is on the left; otherwise on the right. - Extract as
imagePosition: "left"orimagePosition: "right"prop. - Any other component properties or visual variants (e.g. "variant": "filled", "active": true).
- If the component has
-
Normalize the data keys (CRITICAL):
- For text content: use
title,description,label, etc. - For images/icons: ALWAYS use
iconSrc,imageSrc,avatarSrc(with "Src" suffix) -
DO NOT use ambiguous keys like
icon,image,avataralone - This ensures compatibility with standard React component prop naming conventions.
- Example:
json { "title": "Example Title", "description": "Example description", "imageSrc": "@/assets/actual-filename-from-figma.png" }
- For text content: use
-
Generate Props Schema (CRITICAL):
- Based on the first component instance, infer the prop definitions
- For each extracted field (e.g., "title", "description", "imageSrc"), determine:
- key: The property name (e.g., "title")
- type: The TypeScript type - must be one of: "string", "number", "boolean", "string[]", "number[]"
- description: A clear description of what this prop represents
- Return as "props" array with objects containing { key, type, description }
- Example:
json { "key": "title", "type": "string", "description": "Card title text" }
-
CRITICAL Rules:
- USE ACTUAL DATA ONLY: The example above uses placeholder names. You MUST use the actual "characters" and "url" values from the Figma Data provided.
- NO FIGMA IDs: Do NOT include Figma node IDs (like "1:2859") in the output. Only extract actual content data.
- NO PLACEHOLDERS: Do NOT generate fake text or copy paths from examples. If a node does not have a "url" field, do not include an "imageSrc" property.
- Deep Search: Text nodes might be nested deeply inside Frames/Groups. Look recursively for "characters" fields.
-
Layout Information: The Figma Data includes
layoutInfoarray withlayoutDirectionandabsoluteBoundingBoxfor each component instance. Use this to determine layout-related props like image position (left/right) in horizontal layouts. -
Asset Paths - CRITICAL:
- Images are represented by nodes with
type: "IMAGE". These nodes MUST have aurlfield. - You MUST use the EXACT value from the
urlfield as the value for "imageSrc", "iconSrc", or "avatarSrc" without any modifications. - The
urlfield value MUST be a file path (e.g., "@/assets/icon-name.svg"). - DO NOT hallucinate or copy paths from the example above. Every image MUST correspond to a node in the provided Figma Data.
- CORRECT: If a node has
type: "IMAGE"andurl: "@/assets/real-image-123.png", use exactly that. - WRONG: Using "@/assets/start-2.svg" if it's not in the input data.
- If the
urlfield does not exist or does not contain a valid path starting with "@/assets/", omit the iconSrc/imageSrc/avatarSrc field entirely.
- Images are represented by nodes with
- Return a JSON object with two keys:
- "props": Array of prop definitions with { key, type, description }
- "state": Array of data objects for each component instance
- Return ONLY the JSON object. Do not explain.
Example Output JSON Structure (for reference only): { "props": [ { "key": "title", "type": "string", "description": "Card title text" }, { "key": "description", "type": "string", "description": "Card description text" }, { "key": "imageSrc", "type": "string", "description": "Path to card image" } ], "state": [ { "title": "Actual Title 1", "description": "Actual Description 1", "imageSrc": "@/assets/actual-file-1.png" }, { "title": "Actual Title 2", "description": "Actual Description 2", "imageSrc": "@/assets/actual-file-2.png" } ] }