mirror of
https://github.com/fleetdm/fleet
synced 2026-05-17 05:58:40 +00:00
relates to #15515 fix the formatting of the script output by replacing the `\r` characters with `\n` characters. - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. - [x] Manual QA for all new/changed functionality
24 lines
723 B
TypeScript
24 lines
723 B
TypeScript
import React from "react";
|
|
import classnames from "classnames";
|
|
|
|
const baseClass = "textarea";
|
|
|
|
interface ITextareaProps {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
// A textarea component that encapsulates common styles and functionality.
|
|
const Textarea = ({ children, className }: ITextareaProps) => {
|
|
// this is to preserve line breaks when we encounter a carriage return character.
|
|
// We could not find a way to preserve line breaks in the CSS alone for this
|
|
// character.
|
|
if (typeof children === "string") {
|
|
children = children.replace(/\r/g, "\n");
|
|
}
|
|
|
|
const classNames = classnames(baseClass, className);
|
|
return <div className={classNames}>{children}</div>;
|
|
};
|
|
|
|
export default Textarea;
|