fix design bug
This commit is contained in:
@@ -5,11 +5,13 @@ import { motion, Variants } from 'framer-motion';
|
||||
import { Icon, SearchNormal } from 'iconsax-react';
|
||||
import clsx from 'clsx';
|
||||
import { ChevronDown } from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
|
||||
export interface ComboboxOption {
|
||||
id: string;
|
||||
title: string;
|
||||
icon?: Icon;
|
||||
imagePath?: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
@@ -64,7 +66,16 @@ function Combobox({ title, options, placeholder, icon: Icon, expanded, selectedI
|
||||
const activeIcon = selectedOption?.icon && React.createElement(selectedOption.icon, {
|
||||
size: 16,
|
||||
className: "inline-block mr-1 stroke-primary"
|
||||
})
|
||||
});
|
||||
const activeImage = selectedOption?.imagePath && (
|
||||
<Image
|
||||
src={selectedOption.imagePath}
|
||||
alt=""
|
||||
width={20}
|
||||
height={20}
|
||||
className="inline-block mr-1"
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
const variants: Variants = {
|
||||
@@ -117,7 +128,9 @@ function Combobox({ title, options, placeholder, icon: Icon, expanded, selectedI
|
||||
|
||||
<div className="w-full text-sm2 flex items-center justify-start gap-3">
|
||||
{
|
||||
activeIcon ? (
|
||||
activeImage ? (
|
||||
activeImage
|
||||
) : activeIcon ? (
|
||||
activeIcon
|
||||
) : (
|
||||
Icon && <Icon size={16} className="inline-block mr-1 stroke-primary" />
|
||||
@@ -171,7 +184,15 @@ function Combobox({ title, options, placeholder, icon: Icon, expanded, selectedI
|
||||
aria-selected
|
||||
>
|
||||
{
|
||||
v?.icon && React.createElement(v.icon, {
|
||||
v?.imagePath ? (
|
||||
<Image
|
||||
src={v.imagePath}
|
||||
alt=""
|
||||
width={16}
|
||||
height={16}
|
||||
className="inline-block mr-1"
|
||||
/>
|
||||
) : v?.icon && React.createElement(v.icon, {
|
||||
size: 16,
|
||||
className: "inline-block mr-1 stroke-primary"
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user