"""Close — shut the DataTools server down immediately on visit.

Sidebar nav entry. Clicking it routes here, and the page's render
fires :func:`shutdown_app` directly — there is no confirm step. The
browser sees the farewell overlay; the Python process terminates a
moment later via ``os._exit``.
"""

from __future__ import annotations

import sys
from pathlib import Path

import streamlit as st

_project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
    sys.path.insert(0, str(_project_root))

from src.gui.components import hide_streamlit_chrome, shutdown_app
from src.i18n import t

from pathlib import Path as _Path
_ICON_PATH = str(_Path(__file__).parent.parent / "assets" / "datatools_icon_256.png")
st.set_page_config(
    page_title=t("close_page.page_title"),
    page_icon=_ICON_PATH,
    layout="wide",
)
hide_streamlit_chrome()

shutdown_app()
