{% autoescape %}
<h1>{{ trans('Add New Part') }}</h1>

<div class="card mb-4">
    <div class="card-body">
        <form id="addItemForm" enctype="multipart/form-data">
            <input type="hidden" name="action" value="add_item">
            <div class="mb-3">
                <label for="item_name" class="form-label">{{ trans('Part Name') }}</label>
                <input type="text" class="form-control" id="item_name" name="item_name" required>
            </div>
            <div class="mb-3">
                <label for="item_description" class="form-label">{{ trans('Description') }}</label>
                <textarea class="form-control" id="item_description" name="item_description" rows="3"></textarea>
            </div>
            <div class="mb-3">
                <label for="category_id" class="form-label">{{ trans('Category') }}</label>
                <select class="form-select" id="category_id" name="category_id" required>
                    <option value="">{{ trans('-- Select Category --') }}</option>
                    {% for category in categories %}
                        <option value="{{ category.id }}">{{ category.path }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="mb-3">
                <label for="image" class="form-label">{{ trans('Image') }}</label>
                <input type="file" class="form-control" id="image" name="image" accept="image/*">
            </div>
            <div class="mb-3">
                <label for="location" class="form-label">{{ trans('Location') }}</label>
                <input type="text" class="form-control" id="location" name="location">
            </div>
            <button type="submit" class="btn btn-primary">{{ trans('Add Part') }}</button>
        </form>
    </div>
</div>

{% endautoescape %}