# /app/components/Card.py import gradio as gr from html import escape def render_card(title: str, body_html: str | None = None, body_text: str | None = None) -> gr.HTML: """ Generic panel card. Pass raw HTML (sanitized upstream) or plain text. """ if body_html is None: body_html = f"
{escape(body_text or '')}
" t = escape(title or "") html = f"""
{t}
{body_html}
""" return gr.HTML(value=html)