fix text editor voting

deskripsi:
- fix on create & edit
- fix tampilan html di detail
This commit is contained in:
2025-04-30 12:13:18 +08:00
parent ec0e7b1211
commit 801fa8af8b
12 changed files with 146 additions and 99 deletions

View File

@@ -0,0 +1,19 @@
import { Text } from "@mantine/core";
import { MainColor } from "../../color";
export default function Component_V3_Label_TextInput({
text,
}: {
text: string;
}) {
return (
<>
<Text c={MainColor.white} fz={"sm"} fw={500}>
{text}
<Text inherit span c={"red"} px={5}>
*
</Text>
</Text>
</>
);
}

View File

@@ -3,7 +3,7 @@ import { MainColor } from "../../color";
export const Comp_DangerouslySetInnerHTML = ({
props,
color,
style,
style: styleInput,
}: {
props: string | undefined;
color?: string;
@@ -11,20 +11,43 @@ export const Comp_DangerouslySetInnerHTML = ({
}) => {
const baseStyle: React.CSSProperties = {
color: color ?? MainColor.white,
wordBreak: "break-word",
overflow: "hidden",
};
return (
<>
<div
style={{
...baseStyle,
...style,
// wordBreak: "break-word",
...styleInput,
}}
className="rich-html-content"
dangerouslySetInnerHTML={{
__html: props ?? "",
}}
/>
<style>
{`
div p {
margin: 0 0 8px 0;
}
div ul, div ol {
margin: 0 0 8px 20px;
padding-left: 16px;
}
div h1, div h2, div h3 {
margin: 0 0 12px 0;
}
div li {
margin-bottom: 4px;
}
`}
</style>
</>
);
};