"""
Alert component schemas.

Mirrors lightwave-ui/src/components/application/alerts/.
"""

from typing import Literal

from pydantic import BaseModel, ConfigDict, Field

from lightwave.schema.pydantic.ui.types import CTAProps


class AlertProps(BaseModel):
    """
    Alert/banner component props.

    Matches TypeScript AlertProps.
    """

    # Content
    title: str | None = Field(None, description="Alert title")
    message: str = Field(..., description="Alert message")

    # Type/severity
    type: Literal["info", "success", "warning", "error"] = Field("info", description="Alert type/severity")

    # Icons
    icon: str | None = Field(None, description="Custom icon name")
    show_icon: bool = Field(True, serialization_alias="showIcon", description="Show type icon")

    # Actions
    cta: CTAProps | None = Field(None, description="Primary action")
    secondary_cta: CTAProps | None = Field(None, serialization_alias="secondaryCta", description="Secondary action")

    # Dismissible
    dismissible: bool = Field(False, description="Can be dismissed")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


__all__ = [
    "AlertProps",
]
