refactor: update value formatting in combobox components to include names for better context and usability
This commit is contained in:
@@ -118,16 +118,14 @@ export function CategoryCombobox({
|
||||
<span className="text-muted-foreground">
|
||||
Aucune catégorie
|
||||
</span>
|
||||
{value === null && (
|
||||
<Check className="ml-auto h-4 w-4" />
|
||||
)}
|
||||
{value === null && <Check className="ml-auto h-4 w-4" />}
|
||||
</CommandItem>
|
||||
</CommandGroup>
|
||||
<CommandGroup>
|
||||
{parentCategories.map((parent) => (
|
||||
<div key={parent.id}>
|
||||
<CommandItem
|
||||
value={parent.id}
|
||||
value={`${parent.id} ${parent.name}`}
|
||||
onSelect={() => handleSelect(parent.id)}
|
||||
>
|
||||
<CategoryIcon
|
||||
@@ -143,7 +141,7 @@ export function CategoryCombobox({
|
||||
{childrenByParent[parent.id]?.map((child) => (
|
||||
<CommandItem
|
||||
key={child.id}
|
||||
value={child.id}
|
||||
value={`${child.id} ${child.name}`}
|
||||
onSelect={() => handleSelect(child.id)}
|
||||
className="pl-8"
|
||||
>
|
||||
@@ -206,16 +204,14 @@ export function CategoryCombobox({
|
||||
<CommandItem value="__none__" onSelect={() => handleSelect(null)}>
|
||||
<X className="h-4 w-4 text-muted-foreground" />
|
||||
<span className="text-muted-foreground">Aucune catégorie</span>
|
||||
{value === null && (
|
||||
<Check className="ml-auto h-4 w-4" />
|
||||
)}
|
||||
{value === null && <Check className="ml-auto h-4 w-4" />}
|
||||
</CommandItem>
|
||||
</CommandGroup>
|
||||
<CommandGroup>
|
||||
{parentCategories.map((parent) => (
|
||||
<div key={parent.id}>
|
||||
<CommandItem
|
||||
value={parent.id}
|
||||
value={`${parent.id} ${parent.name}`}
|
||||
onSelect={() => handleSelect(parent.id)}
|
||||
>
|
||||
<CategoryIcon
|
||||
@@ -231,7 +227,7 @@ export function CategoryCombobox({
|
||||
{childrenByParent[parent.id]?.map((child) => (
|
||||
<CommandItem
|
||||
key={child.id}
|
||||
value={child.id}
|
||||
value={`${child.id} ${child.name}`}
|
||||
onSelect={() => handleSelect(child.id)}
|
||||
className="pl-8"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user