from __future__ import annotations

from typing import Any
from django.conf import settings

DEFAULTS: dict[str, Any] = {
    "upload_path": "editor101/uploads/",
    "max_image_size_mb": 10,
    "allowed_image_types": ["image/jpeg", "image/png", "image/gif", "image/webp"],
    "toolbar": "minimal",  # "full" | "minimal" | list of item names
    "language": "en",    # "en" | "ru" | "uz"
}


def get_setting(key: str) -> Any:
    user_config: dict[str, Any] = getattr(settings, "EDITOR101", {})
    return user_config.get(key, DEFAULTS[key])
