karusic/front/src/ui/Textarea.tsx

29 lines
701 B
TypeScript

import { ReactNode, CSSProperties, RefObject } from "react";
import { Div } from "./Div";
import { useTheme } from "@/theme/ThemeContext";
export type TextareaProps = {
ref?: RefObject<any>;
value?: string;
onChange?: (e) => void;
style?: Omit<CSSProperties, "fontSize" | "fontWeight" | "color">;
};
export const Textarea = ({
ref,
value,
onChange,
style,
}: TextareaProps) => {
const { convertStyle } = useTheme();
const themedStyle = style ? convertStyle(style) : undefined;
return (
<textarea
ref={ref}
value={value}
onChange={onChange}
style={themedStyle}
>
</textarea>
);
};