mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
- Introduced a new Autocomplete component for improved user experience in selecting options across various UI components. - Refactored BranchAutocomplete and CategoryAutocomplete to utilize the new Autocomplete component, streamlining code and enhancing maintainability. - Updated Playwright configuration to support mock agent functionality during CI/CD, allowing for simulated API interactions without real calls. - Added comprehensive end-to-end tests for feature lifecycle, ensuring robust validation of the complete feature management process. - Enhanced auto-mode service to support mock responses, improving testing efficiency and reliability.
40 lines
892 B
TypeScript
40 lines
892 B
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import { Autocomplete } from "@/components/ui/autocomplete";
|
|
|
|
interface CategoryAutocompleteProps {
|
|
value: string;
|
|
onChange: (value: string) => void;
|
|
suggestions: string[];
|
|
placeholder?: string;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
"data-testid"?: string;
|
|
}
|
|
|
|
export function CategoryAutocomplete({
|
|
value,
|
|
onChange,
|
|
suggestions,
|
|
placeholder = "Select or type a category...",
|
|
className,
|
|
disabled = false,
|
|
"data-testid": testId,
|
|
}: CategoryAutocompleteProps) {
|
|
return (
|
|
<Autocomplete
|
|
value={value}
|
|
onChange={onChange}
|
|
options={suggestions}
|
|
placeholder={placeholder}
|
|
searchPlaceholder="Search category..."
|
|
emptyMessage="No category found."
|
|
className={className}
|
|
disabled={disabled}
|
|
data-testid={testId}
|
|
itemTestIdPrefix="category-option"
|
|
/>
|
|
);
|
|
}
|