feat : big update
This commit is contained in:
@@ -57,6 +57,8 @@ type CatalogDropdownProps<Item extends AdminCatalogItem> = CommonSelectProps<Ite
|
||||
value: string;
|
||||
onValueChange: (value: string) => void;
|
||||
showSelectedImage?: boolean;
|
||||
showClear?: boolean;
|
||||
label?: string;
|
||||
};
|
||||
|
||||
export function CatalogDropdown<Item extends AdminCatalogItem>({
|
||||
@@ -68,6 +70,8 @@ export function CatalogDropdown<Item extends AdminCatalogItem>({
|
||||
invalid = false,
|
||||
rarityBackground = false,
|
||||
showSelectedImage = false,
|
||||
showClear = true,
|
||||
label,
|
||||
searchNames = (item) => [item.name, ...(item.aliases ?? [])],
|
||||
}: CatalogDropdownProps<Item>) {
|
||||
const selected = items.find((item) => item.key === value) ?? null;
|
||||
@@ -97,7 +101,8 @@ export function CatalogDropdown<Item extends AdminCatalogItem>({
|
||||
<ComboboxInput
|
||||
className="w-full"
|
||||
placeholder={placeholder}
|
||||
showClear
|
||||
aria-label={label ?? placeholder}
|
||||
showClear={showClear}
|
||||
aria-invalid={invalid}
|
||||
/>
|
||||
<ComboboxContent className="min-w-72">
|
||||
@@ -186,6 +191,7 @@ type DomainSelectProps<Item extends AdminCatalogItem> = CommonSelectProps<Item>
|
||||
label?: string;
|
||||
className?: string;
|
||||
showSelectedImage?: boolean;
|
||||
showClear?: boolean;
|
||||
};
|
||||
|
||||
function DomainCatalogSelect<Item extends AdminCatalogItem>({
|
||||
@@ -206,7 +212,7 @@ function DomainCatalogSelect<Item extends AdminCatalogItem>({
|
||||
/>
|
||||
);
|
||||
}
|
||||
return <CatalogDropdown {...props} rarityBackground={rarityBackground} showSelectedImage={showSelectedImage} />;
|
||||
return <CatalogDropdown {...props} label={label} rarityBackground={rarityBackground} showSelectedImage={showSelectedImage} />;
|
||||
}
|
||||
|
||||
export function CharacterSelect<Item extends AdminCatalogItem>(props: DomainSelectProps<Item>) {
|
||||
|
||||
Reference in New Issue
Block a user