from __future__ import annotations

from django import forms
from django.urls import reverse_lazy


class SearchForm(forms.Form):
    query = forms.CharField(
        label="Search UK Species Inventory",
        required=False,
        min_length=2,
        max_length=255,
        widget=forms.TextInput(
            attrs={
                "class": "form-control form-control-lg",
                "placeholder": "Start typing to see search suggestions from the UKSI data …",
                "hx-get": reverse_lazy("uksi_browser:search"),
                "hx-target": "#search-results",
                "hx-trigger": "keyup changed delay:400ms",
            }
        ),
    )
