Skip to content

Commit

Permalink
updated styling of custom info
Browse files Browse the repository at this point in the history
  • Loading branch information
abilpraju-aot committed Jan 6, 2025
1 parent df5dc93 commit 76ae652
Showing 1 changed file with 19 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,23 @@ 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
const formattedContent = content.split("\n").map((line, index) => (
<React.Fragment key={index}>
{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 76ae652

Please sign in to comment.