from django.utils.translation import gettext_lazy as _

from wagtail import blocks

from ocyan.plugin.coyote.custom_blocks import IconChoiceBlock
from ocyan.plugin.coyote.icons import ICONS

from .partials import CoyoteButtonBlock


class CoyoteCallToAction(blocks.StructBlock):
    icon = IconChoiceBlock(choices=ICONS, required=False, label=_("Icon"))
    header = blocks.CharBlock(required=False, label=_("Title"))
    body = blocks.TextBlock(required=False, label=_("Body"))
    button = CoyoteButtonBlock(required=False, label=_("Button"))

    class Meta:
        template = "coyote/blocks/footer/calltoaction.html"
        icon = "comment-add"
