package com.ponzischeme89.memby.ui

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import com.ponzischeme89.memby.ui.theme.MembyTheme

/**
 * The one preview shape this app uses: a 1080p TV, landscape, on the launcher's own
 * near-black. A phone-sized preview would be actively misleading — every layout here is
 * built for a 10-foot view and D-pad focus.
 *
 * Previews render the composable only; they do not run `ServiceLocator`, so anything
 * previewable has to take its state as parameters rather than reading the repository.
 * That is worth keeping: it is the same property that makes a composable testable.
 */
@Preview(
    name = "TV 1080p",
    device = Devices.TV_1080p,
    showBackground = true,
    backgroundColor = 0xFF090B0D,
)
annotation class TvPreview

/** Wraps preview content in the real theme, so type and colours match the running app. */
@Composable
fun PreviewSurface(
    alignment: Alignment = Alignment.Center,
    content: @Composable () -> Unit,
) {
    MembyTheme {
        Box(
            modifier = Modifier
                .fillMaxSize()
                .background(Color(0xFF090B0D)),
            contentAlignment = alignment,
        ) {
            content()
        }
    }
}
