# retoor <retoor@molodetz.nl>

from __future__ import annotations

from typing import Any, Optional

from devplacepy.schemas.base import _Out
from devplacepy.schemas.content import UserOut


class AuthPageOut(_Out):
    page: str = ""
    next_url: Optional[str] = None
    registration_closed: Optional[bool] = None
    sent: Optional[bool] = None
    token: Optional[str] = None
    errors: list = []


class LandingArticleOut(_Out):
    uid: str = ""
    slug: str = ""
    title: Optional[str] = None
    description: Optional[str] = None
    url: Optional[str] = None
    source_name: Optional[str] = None
    grade: int = 0
    featured: int = 0
    synced_at: Optional[str] = None
    time_ago: Optional[str] = None
    image_url: Optional[str] = None


class LandingPostOut(_Out):
    post: Optional[Any] = None
    author: Optional[UserOut] = None
    time_ago: Optional[str] = None
    comment_count: int = 0
    stars: int = 0
    slug: str = ""


class TrendingTopicOut(_Out):
    topic: str = ""
    count: int = 0


class LandingOut(_Out):
    is_authenticated: bool = False
    user_post_count: int = 0
    user_stars: int = 0
    user_xp: int = 0
    user_level: int = 1
    xp_progress_pct: int = 0
    unread_count: int = 0
    landing_articles: list[LandingArticleOut] = []
    landing_posts: list[LandingPostOut] = []
    top_contributors: list = []
    trending_topics: list[TrendingTopicOut] = []


class DeviiPageOut(_Out):
    page_title: Optional[str] = None
    meta_description: Optional[str] = None
    meta_robots: Optional[str] = None
    canonical_url: Optional[str] = None
    og_title: Optional[str] = None
    og_description: Optional[str] = None
    og_image: Optional[str] = None
    og_type: Optional[str] = None
    breadcrumbs: list = []
    page_schema: Optional[Any] = None
    prev_url: Optional[str] = None
    next_url: Optional[str] = None
    user: Optional[Any] = None
