"""A complete DyUI app that shows the `file` component.

Save it as app.py, then run:  dyui run app.py
"""
import dyui
from dyui import ui

app = dyui.App(title="File demo", starters=["Show me"], persist=False)


@app.on_message
async def reply(msg: dyui.Message, chat: dyui.Chat):
    yield "Here is the `file` component."
    yield ui.File("report.pdf", "/api/files/f_123", size=48213, type="application/pdf")
