import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
import { loadSettings } from '../actions/load-settings.js';
import { getAvailableTerminals } from '../actions/get-available-terminals.js';
import { SettingsPageClient } from '../../components/features/settings/settings-page-client.js';
/** Skip static pre-rendering since we need runtime DI container and server context. */
export const dynamic = 'force-dynamic';
export default async function SettingsPage() {
    const [{ settings, shepHome, dbFileSize, error }, availableTerminals] = await Promise.all([
        loadSettings(),
        getAvailableTerminals(),
    ]);
    if (error || !settings) {
        return (_jsx("div", { className: "flex h-full flex-col p-6", children: _jsxs("p", { className: "text-destructive text-sm", children: ["Failed to load settings: ", error] }) }));
    }
    return (_jsx("div", { className: "flex h-full flex-col px-6 pb-6", children: _jsx(SettingsPageClient, { settings: settings, shepHome: shepHome ?? '', dbFileSize: dbFileSize ?? 'Unknown', availableTerminals: availableTerminals }) }));
}
