"""Pillar-Registry: alle Pillars in fester Reihenfolge."""
from __future__ import annotations

from taninux.bundles.pillar import BUNDLES
from taninux.flatpak.pillar import FLATPAK
from taninux.health.pillar import HEALTH
from taninux.kernel.pillar import KERNEL
from taninux.maintain.pillar import MAINTAIN
from taninux.overview.pillar import OVERVIEW
from taninux.packages.pillar import PACKAGES
from taninux.pillars.base import Pillar
from taninux.suggest.pillar import SUGGEST
from taninux.update.pillar import UPDATE


PILLARS: list[Pillar] = [
    OVERVIEW,
    PACKAGES,
    MAINTAIN,
    UPDATE,
    BUNDLES,
    SUGGEST,
    FLATPAK,
    KERNEL,
    HEALTH,
]


def by_key(key: str) -> Pillar | None:
    for p in PILLARS:
        if p.key == key:
            return p
    return None
