-
Notifications
You must be signed in to change notification settings - Fork 352
Expand file tree
/
Copy pathuse-hash-warning.component.tsx
More file actions
41 lines (35 loc) · 1.12 KB
/
use-hash-warning.component.tsx
File metadata and controls
41 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"use client";
import React from "react";
import styles from "./use-hash-warning.module.scss";
import {
HashWarningVisibilityValues,
useDecoderStore,
} from "@/features/decoder/services/decoder.store";
import { getWarningsUiDictionary } from "@/features/localization/services/ui-language-dictionary.service";
interface UseHashWarningComponentProps {
languageCode: string;
}
export const UseHashWarningComponent: React.FC<
UseHashWarningComponentProps
> = ({ languageCode }) => {
const useHashWarningVisibility = useDecoderStore(
(state) => state.useHashWarningVisibility,
);
const hideUseHashWarning = useDecoderStore(
(state) => state.hideUseHashWarning,
);
const dictionary = getWarningsUiDictionary(languageCode);
if (useHashWarningVisibility === HashWarningVisibilityValues.VISIBLE) {
return (
<div className={styles.backdrop} onClick={hideUseHashWarning}>
<div className={styles.container}>
<button className={styles.button} onClick={hideUseHashWarning}>
+
</button>
<dictionary.useHash.Modal />
</div>
</div>
);
}
return null;
};