<section class="flex flex-col gap-4">
    {% include 'lib/alert.twig' %}
    <form action="/admin/subscriptions/add" method="post" class="flex flex-col gap-4">
        {% include 'lib/inputs/text.twig' with {
            type: 'text',
            name: 'user_identifier',
            label: 'User Identifier',
            placeholder: 'Enter email or user ID',
            required: true
        } %}
        <label for="product_id" class="block text-sm font-medium mt-2">
            Subscription Product
            <span class="{{ colors.error.text }} ml-4">*</span>
        </label>
        <select id="product_id" name="product_id" class="border rounded-lg p-2 w-full" required>
            <option value="">-- Select Product --</option>
            {% for product in subscription_products %}
                <option value="{{ product.id }}">
                    {{ product.title }} ({{ product.subscription_frequency }} - {{ product.price_cents }} cents / {{ product.price_sats }} sats)
                </option>
            {% endfor %}
        </select>
        {% include 'lib/inputs/select.twig' with {
            id: 'frequency',
            name: 'frequency',
            label: 'Frequency Override',
            options: [
                { 'label': 'Per Minute', 'value': 'minute' },
                { 'label': 'Hourly', 'value': 'hour' },
                { 'label': 'Daily', 'value': 'day' },
                { 'label': 'Weekly', 'value': 'week' },
                { 'label': 'Monthly', 'value': 'month' },
                { 'label': 'Yearly', 'value': 'year' }
            ],
            value: 'month',
            no_option: { 'label': '-- Use Product Default --', 'value': '' }
        } %}
        {% include 'lib/inputs/select.twig' with {
            id: 'state',
            name: 'state',
            label: 'Initial State',
            options: [
                { 'label': 'Trial', 'value': 'TRIAL' },
                { 'label': 'Start', 'value': 'START' },
                { 'label': 'Renewal', 'value': 'RENEWAL' }
            ],
            value: 'START'
        } %}
        {% include 'lib/buttons/submit.twig' with {
            label: 'Create Subscription',
        } %}
    </form>
</section>
