"""Chat forms."""

from __future__ import annotations

from flask_wtf import FlaskForm
from wtforms import SubmitField, TextAreaField
from wtforms.validators import DataRequired, Length

from app.chat.constants import MAX_MESSAGE_LENGTH


class MessageForm(FlaskForm):
    """A single chat message. Server-side rules live in the service layer."""

    message = TextAreaField(
        "Message",
        validators=[DataRequired(), Length(max=MAX_MESSAGE_LENGTH)],
    )
    submit = SubmitField("Send")
