mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-08 11:13:58 +08:00
Add Prettier. Remove unused Button component
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import clsx from 'clsx'
|
||||
import clsx from "clsx";
|
||||
|
||||
const formClasses =
|
||||
'block w-full appearance-none rounded-lg border border-gray-200 bg-white py-[calc(theme(spacing.2)-1px)] px-[calc(theme(spacing.3)-1px)] text-gray-900 placeholder:text-gray-400 focus:border-cyan-500 focus:outline-none focus:ring-cyan-500 sm:text-sm'
|
||||
"block w-full appearance-none rounded-lg border border-gray-200 bg-white py-[calc(theme(spacing.2)-1px)] px-[calc(theme(spacing.3)-1px)] text-gray-900 placeholder:text-gray-400 focus:border-cyan-500 focus:outline-none focus:ring-cyan-500 sm:text-sm";
|
||||
|
||||
function Label({ id, children }) {
|
||||
return (
|
||||
@@ -11,23 +11,23 @@ function Label({ id, children }) {
|
||||
>
|
||||
{children}
|
||||
</label>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function TextField({ id, label, type = 'text', className, ...props }) {
|
||||
export function TextField({ id, label, type = "text", className, ...props }) {
|
||||
return (
|
||||
<div className={className}>
|
||||
{label && <Label id={id}>{label}</Label>}
|
||||
<input id={id} type={type} {...props} className={formClasses} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function SelectField({ id, label, className, ...props }) {
|
||||
return (
|
||||
<div className={className}>
|
||||
{label && <Label id={id}>{label}</Label>}
|
||||
<select id={id} {...props} className={clsx(formClasses, 'pr-8')} />
|
||||
<select id={id} {...props} className={clsx(formClasses, "pr-8")} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user