interface Props {
tag?: "span" | "div";
style?: React.CSSProperties;
children?: React.ReactNode;
}
export const NoWrap: React.FC<Props> = ({
children,
tag = "span",
style,
}: Props) => {
const elStyle: React.CSSProperties = { whiteSpace: "nowrap", ...style };
switch (tag) {
case "span":
return <span style={elStyle}>{children}</span>;
case "div":
return <div style={elStyle}>{children}</div>;
}
};