function genAdCard(ctx,option) {
  const { json5: vcard } = ctx;

  return {
    type: "flex",
    altText: "廣告卡片",
    contents: {
      type: "carousel",
      contents: [
        ctx.contents,
        {
            "type": "bubble",
            "size":"mega",
            "hero": {
                "type": "image",
                "url": option.ad_image,
                "size": "full",
                "aspectMode": "cover",
                "aspectRatio": "19:11",
                "action": {
                    "type": "uri",
                    "uri": option.link
                }
            },
            "body": {
                "type": "box",
                "layout": "vertical",
                "contents": [
                    {
                        "type": "text",
                        "text": option.ad_title,
                        "weight": "bold",
                        "size": "xl",
                        "color": "#333333"
                    },
                    {
                        "type": "text",
                        "text": option.ad_desc,
                        "color": "#666666",
                        "size": "md",
                        "wrap": true
                    }
                ]
            },
            "footer": {
                "type": "box",
                "layout": "vertical",
                "spacing": "sm",
                "color": "#6c6664",
                "contents": [
                  {
                    "type": "button",
                    "style": "primary",
                    "height": "sm",
                    "color": "#6c6664",
                    "action": {
                      "type": "uri",
                      "label": "test link",
                      "uri": "https://linecorp.com"
                    }
                  },
                  {
                    "type": "box",
                    "layout": "vertical",
                    "contents": [],
                    "margin": "sm"
                  }
                ],
                "flex": 0
            },
            "styles": {
                "body": {
                  "backgroundColor": "#eeeeee"
                },
                "footer": {
                  "backgroundColor": "#eeeeee"
                }
            }
        }
      ]
    },
  };
}

export { genAdCard };