# Trinity Score: 90.0 (Established by Chancellor)
from pydantic import BaseModel, Field


class ComponentProp(BaseModel):
    name: str = Field(..., description="Name of the prop")
    type: str = Field(..., description="TypeScript type of the prop")
    description: str = Field(..., description="Description of what this prop does")
    required: bool = Field(True, description="Is this prop required?")


class ComponentSchema(BaseModel):
    """Blueprint for a React Component generated by GenUI.
    Truth (眞): Strict structure prevents hallucinations.
    """

    name: str = Field(..., description="PascalCase name of the component")
    description: str = Field(..., description="Purpose of the component")
    imports: list[str] = Field(default_factory=list, description="List of import statements")
    props: list[ComponentProp] = Field(
        default_factory=list, description="Props interface definition"
    )
    code: str = Field(..., description="The full JSX/TSX implementation code")
    css_classes: list[str] = Field(
        default_factory=list, description="Tailwind types used (for analytics)"
    )

    classification: str = Field(..., description="Atom, Molecule, or Organism")
    trinity_score: int = Field(0, description="Estimated compliance score (0-100)")
    risk_score: int = Field(0, description="Estimated risk score (0-100)")
