Skip to content

Commit

Permalink
Merge pull request #400 from abilpraju-aot/fwf-4167
Browse files Browse the repository at this point in the history
updated styling of custom info
  • Loading branch information
arun-s-aot authored Jan 7, 2025
2 parents 7554893 + 403b71c commit a92f553
Showing 1 changed file with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React ,{ FC } from "react";
import React, { FC } from "react";
import { useTranslation } from "react-i18next";
import { InfoIcon } from "../SvgIcons/index";

Expand All @@ -14,16 +14,24 @@ export const CustomInfo: FC<CustomInfoProps> = ( {
content ,
className ,
}) => {
const { t } = useTranslation();
return (
<div className={`info-panel ${className}`}>
<div className="d-flex align-items-center">
<InfoIcon />
<div className="field-label ms-2">{t(heading)}</div>
</div>
<div className="info-content">
{t(content)}
</div>
const { t } = useTranslation();

// Replace `\n` with <br /> tags and use the line itself as a key
const formattedContent = content.split("\n").map((line) => (
<React.Fragment key={line.trim().replace(/\s+/g, "-")}>
{t(line)}
<br />
</React.Fragment>
));


return (
<div className={`info-panel ${className}`}>
<div className="d-flex align-items-center">
<InfoIcon />
<div className="field-label ms-2">{t(heading)}</div>
</div>
)
<div className="info-content">{formattedContent}</div> {/* Render formatted content */}
</div>
);
};

0 comments on commit a92f553

Please sign in to comment.