import React from 'react';
import { useTranslation } from 'react-i18next';

const TestTranslation = () => {
  const { t, i18n } = useTranslation();

  return (
    <div className="p-4">
      <h1>Translation Test</h1>
      <p>Current language: {i18n.language}</p>
      <p>Dashboard translation: {t('navigation.dashboard')}</p>
      <p>Loading translation: {t('common.loading')}</p>
      <p>Error translation: {t('common.error')}</p>
      <button 
        onClick={() => i18n.changeLanguage('sv')}
        className="bg-blue-500 text-white px-4 py-2 rounded mr-2"
      >
        Switch to Swedish
      </button>
      <button 
        onClick={() => i18n.changeLanguage('en')}
        className="bg-green-500 text-white px-4 py-2 rounded"
      >
        Switch to English
      </button>
    </div>
  );
};

export default TestTranslation;