Updated channel editor & fixes

This commit is contained in:
Sacha Weatherstone
2021-10-27 07:17:50 +11:00
parent 8a9c0a268a
commit 672d23d19c
27 changed files with 530 additions and 249 deletions
+30
View File
@@ -0,0 +1,30 @@
import React from 'react';
import { InputWrapper } from './InputWrapper.jsx';
import { Label } from './Label.jsx';
type DefaultInputProps = JSX.IntrinsicElements['input'];
interface InputProps extends DefaultInputProps {
label?: string;
error?: string;
action?: JSX.Element;
}
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
function Input({ label, error, action, ...props }: InputProps, ref) {
return (
<div className="w-full">
{label && <Label label={label} error={error} />}
<InputWrapper error={error} disabled={props.disabled}>
<input
ref={ref}
className="w-full h-10 px-3 py-2 bg-transparent focus:outline-none focus:border-primary"
{...props}
/>
{action && <div className="flex mr-1">{action}</div>}
</InputWrapper>
</div>
);
},
);