so now we're on fly.io

This commit is contained in:
EGOIST
2022-05-16 14:13:44 +08:00
parent 358c6631cb
commit c3aa3fd967
116 changed files with 418 additions and 1828 deletions
+46
View File
@@ -0,0 +1,46 @@
import clsx from "clsx"
import { DetailedHTMLProps, forwardRef, InputHTMLAttributes } from "react"
type Props = DetailedHTMLProps<
InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
> & {
label?: string
addon?: string
isBlock?: boolean
error?: string
}
export const Input = forwardRef<HTMLInputElement, Props>(function Input(
{ label, addon, className, isBlock, error, ...inputProps },
ref
) {
const hasAddon = !!addon
return (
<div>
{label && (
<label className="form-label" htmlFor={inputProps.id}>
{label}
</label>
)}
<div className="flex items-center">
<input
{...inputProps}
ref={ref}
className={clsx(
"input",
hasAddon && `has-addon`,
isBlock && `is-block`,
className
)}
/>
{addon && (
<span className="flex items-center px-3 text-gray-600 bg-gray-50 h-10 border border-l-0 rounded-r-lg relative -z-10">
{addon}
</span>
)}
</div>
{error && <div className="text-sm mt-1 text-red-500">{error}</div>}
</div>
)
})