diff --git a/app/(pages)/(content)/anime/[slug]/page.tsx b/app/(pages)/(content)/anime/[slug]/page.tsx index 3d0dd7c8..45d1a68b 100644 --- a/app/(pages)/(content)/anime/[slug]/page.tsx +++ b/app/(pages)/(content)/anime/[slug]/page.tsx @@ -3,6 +3,7 @@ import { FC } from 'react'; import Characters from '@/features/anime/anime-view/characters/characters.component'; import Description from '@/features/anime/anime-view/description.component'; import Details from '@/features/anime/anime-view/details/details.component'; +import Warning from '@/features/anime/anime-view/details/warning.component'; import Followings from '@/features/anime/anime-view/followings/followings.component'; import Franchise from '@/features/anime/anime-view/franchise.component'; import Links from '@/features/anime/anime-view/links/links.component'; @@ -37,6 +38,7 @@ const AnimePage: FC = async ({ params }) => { dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} />
+ diff --git a/app/(pages)/(content)/manga/[slug]/page.tsx b/app/(pages)/(content)/manga/[slug]/page.tsx index 5089ab22..1f5ccef2 100644 --- a/app/(pages)/(content)/manga/[slug]/page.tsx +++ b/app/(pages)/(content)/manga/[slug]/page.tsx @@ -3,6 +3,7 @@ import { FC } from 'react'; import Characters from '@/features/manga/manga-view/characters/characters.component'; import Description from '@/features/manga/manga-view/description.component'; import Details from '@/features/manga/manga-view/details/details.component'; +import Warning from '@/features/manga/manga-view/details/warning.component'; import Franchise from '@/features/manga/manga-view/franchise.component'; import Links from '@/features/manga/manga-view/links/links.component'; import ReadStats from '@/features/manga/manga-view/read-stats/read-stats.component'; @@ -18,6 +19,7 @@ const MangaPage: FC = async ({ params }) => { return (
+ diff --git a/app/(pages)/(content)/novel/[slug]/page.tsx b/app/(pages)/(content)/novel/[slug]/page.tsx index 26da30a0..2b2b371a 100644 --- a/app/(pages)/(content)/novel/[slug]/page.tsx +++ b/app/(pages)/(content)/novel/[slug]/page.tsx @@ -3,6 +3,7 @@ import { FC } from 'react'; import Characters from '@/features/novel/novel-view/characters/characters.component'; import Description from '@/features/novel/novel-view/description.component'; import Details from '@/features/novel/novel-view/details/details.component'; +import Warning from '@/features/novel/novel-view/details/warning.component'; import Franchise from '@/features/novel/novel-view/franchise.component'; import Links from '@/features/novel/novel-view/links/links.component'; import ReadStats from '@/features/novel/novel-view/read-stats/read-stats.component'; @@ -18,6 +19,7 @@ const NovelPage: FC = async ({ params }) => { return (
+ diff --git a/features/anime/anime-view/details/warning.component.tsx b/features/anime/anime-view/details/warning.component.tsx new file mode 100644 index 00000000..8dcb7a5f --- /dev/null +++ b/features/anime/anime-view/details/warning.component.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { useParams } from 'next/navigation'; + +import P from '@/components/typography/p'; +import Block from '@/components/ui/block'; +import Card from '@/components/ui/card'; + +import { WARNING_WORDS } from '@/utils/constants'; + +import useAnimeInfo from '@/services/hooks/anime/use-anime-info'; + +const Warning = () => { + const params = useParams(); + const { data } = useAnimeInfo({ slug: String(params.slug) }); + + if (!data || !WARNING_WORDS.some(word => data.slug.includes(word.toLowerCase()))) { + return null; + } + + return ( + + +

+ {"Примітка модерації"} +

+

Цей твір просуває російську культуру та не рекомендований до перегляду чи читання.

+
+
+ ); +}; + +export default Warning; diff --git a/features/manga/manga-view/details/warning.component.tsx b/features/manga/manga-view/details/warning.component.tsx new file mode 100644 index 00000000..5bd21332 --- /dev/null +++ b/features/manga/manga-view/details/warning.component.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { useParams } from 'next/navigation'; + +import P from '@/components/typography/p'; +import Block from '@/components/ui/block'; +import Card from '@/components/ui/card'; + +import { WARNING_WORDS } from '@/utils/constants'; + +import useMangaInfo from '@/services/hooks/manga/use-manga-info'; + +const Warning = () => { + const params = useParams(); + const { data } = useMangaInfo({ slug: String(params.slug) }); + + if (!data || !WARNING_WORDS.some(word => data.slug.includes(word.toLowerCase()))) { + return null; + } + + return ( + + +

+ {"Примітка модерації"} +

+

Цей твір просуває російську культуру та не рекомендований до перегляду чи читання.

+
+
+ ); +}; + +export default Warning; diff --git a/features/novel/novel-view/details/warning.component.tsx b/features/novel/novel-view/details/warning.component.tsx new file mode 100644 index 00000000..78015cc5 --- /dev/null +++ b/features/novel/novel-view/details/warning.component.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { useParams } from 'next/navigation'; + +import P from '@/components/typography/p'; +import Block from '@/components/ui/block'; +import Card from '@/components/ui/card'; + +import { WARNING_WORDS } from '@/utils/constants'; + +import useNovelInfo from '@/services/hooks/novel/use-novel-info'; + +const Warning = () => { + const params = useParams(); + const { data } = useNovelInfo({ slug: String(params.slug) }); + + if (!data || !WARNING_WORDS.some(word => data.slug.includes(word.toLowerCase()))) { + return null; + } + + return ( + + +

+ {"Примітка модерації"} +

+

Цей твір просуває російську культуру та не рекомендований до перегляду чи читання.

+
+
+ ); +}; + +export default Warning; diff --git a/utils/constants.ts b/utils/constants.ts index 07a3c792..e76e17da 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -1064,3 +1064,8 @@ export const USER_ROLE = { color: '#40518F', }, }; + +export const WARNING_WORDS = [ + atob('UnVzc2lh'), + atob('UnVzc2lhbg=='), +]