mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 04:02:41 +08:00
给所有select元素添加一个右侧下拉按钮
This commit is contained in:
@@ -3,6 +3,7 @@ import LoadingIcon from "../icons/three-dots.svg";
|
||||
import CloseIcon from "../icons/close.svg";
|
||||
import EyeIcon from "../icons/eye.svg";
|
||||
import EyeOffIcon from "../icons/eye-off.svg";
|
||||
import DownIcon from "../icons/down.svg";
|
||||
|
||||
import { createRoot } from "react-dom/client";
|
||||
import React, { HTMLProps, useEffect, useState } from "react";
|
||||
@@ -244,3 +245,23 @@ export function PasswordInput(props: HTMLProps<HTMLInputElement>) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function Select(
|
||||
props: React.DetailedHTMLProps<
|
||||
React.SelectHTMLAttributes<HTMLSelectElement>,
|
||||
HTMLSelectElement
|
||||
>,
|
||||
) {
|
||||
const { className, children, ...otherProps } = props;
|
||||
return (
|
||||
<div className={styles["select-with-icon"]}>
|
||||
<select
|
||||
className={`${styles["select-with-icon-select"]} ${className}`}
|
||||
{...otherProps}
|
||||
>
|
||||
{children}
|
||||
</select>
|
||||
<DownIcon className={styles["select-with-icon-icon"]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user