Skip to content

Commit

Permalink
fix: modif v2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Dec 28, 2024
1 parent 4ea6235 commit 407eded
Show file tree
Hide file tree
Showing 147 changed files with 448 additions and 10,378 deletions.
2 changes: 2 additions & 0 deletions packages/code-du-travail-frontend/pages/outils/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
HeuresRechercheEmploi,
SimulateurIndemnitePrecarite,
CalculateurPreavisRetraite,
CalculateurIndemniteLicenciement,
} from "../../src/outils";
import {
getBySlugTools,
Expand All @@ -33,6 +34,7 @@ const toolsBySlug = {
"preavis-licenciement": DureePreavisLicenciement,
"preavis-retraite": CalculateurPreavisRetraite,
"procedure-licenciement": DismissalProcess,
"indemnite-licenciement": CalculateurIndemniteLicenciement,
};

export interface Props {
Expand Down
27 changes: 25 additions & 2 deletions packages/code-du-travail-frontend/src/modules/common/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@ import { xssWrapper } from "../../lib";
type Props = {
children: string;
as?: string;
inline?: boolean;
};

const Html = ({ children, ...props }: Props): JSX.Element => {
if (props.as === "p") {
return (
<p
dangerouslySetInnerHTML={{
__html: xssWrapper(children),
}}
/>
);
} else if (props.as === "span") {
return (
<span
dangerouslySetInnerHTML={{
__html: xssWrapper(children),
}}
/>
);
} else if (props.as === "div") {
return (
<div
dangerouslySetInnerHTML={{
__html: xssWrapper(children),
}}
/>
);
}
return (
<div
{...props}
dangerouslySetInnerHTML={{
__html: xssWrapper(children),
}}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 407eded

Please sign in to comment.