Files
mwitnessing/components/privacy-policy/PrivacyPolicyContainer.jsx
2024-02-22 04:19:38 +02:00

28 lines
893 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { useState } from 'react';
import PrivacyPolicyEN from './PrivacyPolicyEN';
import PrivacyPolicyBG from './PrivacyPolicyBG';
export default function PrivacyPolicyContainer() {
const [language, setLanguage] = useState('bg'); // default language is Bulgarian
const toggleLanguage = () => {
setLanguage(language === 'en' ? 'bg' : 'en');
};
return (
<div className="bg-white shadow-lg rounded-lg overflow-hidden">
<div className="px-4 py-5 sm:px-6">
<button
onClick={toggleLanguage}
className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
>
{language === 'en' ? 'На български' : 'In English'}
</button>
</div>
<div className="border-t border-gray-200">
{language === 'en' ? <PrivacyPolicyEN /> : <PrivacyPolicyBG />}
</div>
</div>
);
}