'use client' import { Cookies, Platforms, XVideosOrientations, PornHubOrientations, YouPornOrientations, RedTubeOrientations } from '@/meta/settings'; import css from './Orientation.module.scss' import React from 'react'; import { setCookie } from '@/utils/cookies/write'; import { useCookies } from 'react-cookie'; interface Props { handleClose(): void labels: { title: string, } } const getOrientations = (platform: Platforms):Object => { if ([Platforms.xnxx, Platforms.xvideos].includes(platform)) { return XVideosOrientations } if([Platforms.youporn].includes(platform)) { return YouPornOrientations } if([Platforms.redtube].includes(platform)) { return RedTubeOrientations } return PornHubOrientations } const Orientation: React.FC = (props) => { const { labels, handleClose } = props const [cookies] = useCookies([Cookies.orientation, Cookies.platform]); const orientationsList = cookies.platform ? getOrientations(cookies.platform ) : XVideosOrientations const handleChange = async (event: React.ChangeEvent) => { const value = event.target.value; await setCookie(Cookies.orientation, value) handleClose() } return (
{labels.title}
); }; export default Orientation;