web: FactBoxBlock does not use useState
This commit is contained in:
@@ -1,19 +1,24 @@
|
|||||||
import { useId, useState } from "react";
|
|
||||||
import { FactBoxBlock as FactBoxBlockType } from "@/gql/graphql";
|
import { FactBoxBlock as FactBoxBlockType } from "@/gql/graphql";
|
||||||
import styles from "./factBoxBlock.module.scss";
|
import styles from "./factBoxBlock.module.scss";
|
||||||
import { Blocks } from "./Blocks";
|
|
||||||
|
|
||||||
type FactBoxBlockTypeWithAlias = FactBoxBlockType & {
|
type FactBoxBlockTypeWithAlias = FactBoxBlockType & {
|
||||||
factBoxBody?: string
|
factBoxBody?: string;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const FactBoxBlock = ({ block }: { block: FactBoxBlockTypeWithAlias }) => {
|
export const FactBoxBlock = ({
|
||||||
|
block,
|
||||||
|
}: {
|
||||||
|
block: FactBoxBlockTypeWithAlias;
|
||||||
|
}) => {
|
||||||
if (!block.factBoxBody) {
|
if (!block.factBoxBody) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<section className={styles.factBoxWrapper}>
|
<section className={styles.factBoxWrapper}>
|
||||||
<div className={styles.factBox} data-background-color={block.backgroundColor ?? ""}>
|
<div
|
||||||
|
className={styles.factBox}
|
||||||
|
data-background-color={block.backgroundColor ?? ""}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={styles.factBoxContent}
|
className={styles.factBoxContent}
|
||||||
dangerouslySetInnerHTML={{ __html: block.factBoxBody }}
|
dangerouslySetInnerHTML={{ __html: block.factBoxBody }}
|
||||||
|
Reference in New Issue
Block a user