fix design bug

This commit is contained in:
hamid zarghami
2025-12-24 11:32:29 +03:30
parent 4c4431198e
commit 26d11db1d4
15 changed files with 134 additions and 33 deletions
+24 -3
View File
@@ -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"
})