mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
input with icon
This commit is contained in:
parent
531c054163
commit
90eb9429fd
1 changed files with 26 additions and 2 deletions
|
|
@ -20,6 +20,30 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|||
);
|
||||
},
|
||||
);
|
||||
Input.displayName = "Input";
|
||||
|
||||
export { Input };
|
||||
export interface InputWithIconProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||
icon: React.ReactNode;
|
||||
}
|
||||
|
||||
const InputWithIcon = React.forwardRef<HTMLInputElement, InputWithIconProps>(
|
||||
({ className, type, icon, ...props }, ref) => {
|
||||
return (
|
||||
<div className="border-rgray-6 text-rgray-12 ring-offset-rgray-2 focus-within:ring-rgray-7 flex h-10 w-full items-center justify-center gap-2 rounded-md border bg-transparent px-3 py-2 text-sm transition focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 ">
|
||||
{icon}
|
||||
<input
|
||||
type={type}
|
||||
className={cn(
|
||||
"placeholder:text-rgray-11 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 ",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
InputWithIcon.displayName = "Input";
|
||||
|
||||
export { Input, InputWithIcon };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue