diff --git a/src/components/layouts/FrontendLayout.tsx b/src/components/layouts/FrontendLayout.tsx index f5ac19a..b5a36bf 100644 --- a/src/components/layouts/FrontendLayout.tsx +++ b/src/components/layouts/FrontendLayout.tsx @@ -1,5 +1,7 @@ import React from 'react'; import FrontendStyles from './FrontendStyles'; +import CurrencySelector from '@/components/CurrencySelector'; +import LanguageSelector from '@/components/LanguageSelector'; interface FrontendLayoutProps { children: React.ReactNode; @@ -9,6 +11,10 @@ const FrontendLayout: React.FC = ({ children }) => { return ( <> +
+ + +
{children} ); diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 00a5adc..652a86e 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -5,9 +5,11 @@ import PlacesSection from "@/components/PlacesSection"; import BlogSection from "@/components/BlogSection"; import Footer from "@/components/Footer"; import { AIFloatingAssistant } from "@/components/AIFloatingAssistant"; +import { useLanguage } from "@/contexts/LanguageContext"; const Index = () => { const navigate = useNavigate(); + const { t } = useLanguage(); const [searchQuery, setSearchQuery] = useState(""); const [selectedLocation, setSelectedLocation] = useState(""); @@ -23,12 +25,12 @@ const Index = () => { }; const categories = [ - { icon: "🏒", title: "Apartment", count: "99+" }, - { icon: "🍽️", title: "Restaurant", count: "55+" }, - { icon: "🎭", title: "Events/Arts", count: "55+" }, - { icon: "πŸ›οΈ", title: "Shops", count: "80+" }, - { icon: "πŸ›οΈ", title: "Museum", count: "96+" }, - { icon: "πŸ’ͺ", title: "Gymnasiums", count: "21+" } + { icon: "🏒", title: t('apartments'), count: "99+" }, + { icon: "🍽️", title: t('restaurants'), count: "55+" }, + { icon: "🎭", title: t('events'), count: "55+" }, + { icon: "πŸ›οΈ", title: t('shops'), count: "80+" }, + { icon: "πŸ›οΈ", title: t('museums'), count: "96+" }, + { icon: "πŸ’ͺ", title: t('gyms'), count: "21+" } ]; return ( @@ -66,9 +68,9 @@ const Index = () => {
- Home - Explore - About + {t('home')} + {t('explore')} + {t('about')}
@@ -83,7 +85,7 @@ const Index = () => { className="hidden sm:flex items-center space-x-2 bg-orange-500 hover:bg-orange-600 text-white px-4 py-2 rounded-full transition-colors" > βž• - Add Listing + {t('addListing')}
@@ -99,15 +101,13 @@ const Index = () => {
- WE ARE #1 ON THE MARKET + {t('heroBadge')}

- We're Here to Help You -
- Navigate While Traveling + {t('heroTitle')}

- You'll get comprehensive results based on the provided location. + {t('heroSubtitle')}
{/* Search Form */} @@ -119,7 +119,7 @@ const Index = () => { setSearchQuery(e.target.value)} onKeyPress={(e) => e.key === 'Enter' && handleSearch()} @@ -133,7 +133,7 @@ const Index = () => { value={selectedLocation} onChange={(e) => setSelectedLocation(e.target.value)} > - + @@ -145,7 +145,7 @@ const Index = () => { className="bg-orange-500 hover:bg-orange-600 text-white px-6 py-3 rounded-full transition-colors" onClick={handleSearch} > - Search places + {t('searchButton')}
@@ -172,7 +172,7 @@ const Index = () => { {category.title} -

{category.count} listings

+

{category.count} {t('listings')}

@@ -189,13 +189,11 @@ const Index = () => {
-
Best Way

- Find Your Dream Place The Best Way + {t('processTitle')}

- Discover exciting categories. - Find what you're looking for. + {t('processSubtitle')}
@@ -207,7 +205,7 @@ const Index = () => { 1

- Input your location to start looking for landmarks. + {t('step1')}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pharetra vitae quam integer semper. @@ -219,7 +217,7 @@ const Index = () => { 2

- Make an appointment at the place you want to visit. + {t('step2')}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pharetra vitae quam integer. @@ -231,7 +229,7 @@ const Index = () => { 3

- Visit the place and enjoy the experience. + {t('step3')}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pharetra vitae quam integer aenean. diff --git a/src/pages/dashboard/commerce/Cashier.tsx b/src/pages/dashboard/commerce/Cashier.tsx index d62ae6a..0ff110a 100644 --- a/src/pages/dashboard/commerce/Cashier.tsx +++ b/src/pages/dashboard/commerce/Cashier.tsx @@ -7,9 +7,11 @@ import { Label } from '@/components/ui/label'; import { Badge } from '@/components/ui/badge'; import { useToast } from '@/hooks/use-toast'; import { useLanguage } from '@/contexts/LanguageContext'; +import { useCurrency } from '@/contexts/CurrencyContext'; const Cashier = () => { const { t } = useLanguage(); + const { formatAmount } = useCurrency(); const { toast } = useToast(); const [cashierData] = useState({ openingBalance: 1000.00, @@ -50,55 +52,55 @@ const Cashier = () => {

-

Control de Caja

-

Gestiona el flujo de efectivo de tu tienda

+

{t('cashierControl')}

+

{t('cashierControl')}

- - + +
- Saldo Inicial + {t('openingBalance')} -
${cashierData.openingBalance.toFixed(2)}
+
{formatAmount(cashierData.openingBalance)}
- Saldo Actual + {t('currentBalance')} -
${cashierData.currentBalance.toFixed(2)}
+
{formatAmount(cashierData.currentBalance)}
- Ventas del DΓ­a + {t('dailySales')} -
${cashierData.totalSales.toFixed(2)}
+
{formatAmount(cashierData.totalSales)}

{cashierData.transactionsCount} transacciones

- Gastos + {t('expenses')} -
${cashierData.totalExpenses.toFixed(2)}
+
{formatAmount(cashierData.totalExpenses)}
diff --git a/src/pages/dashboard/commerce/Customers.tsx b/src/pages/dashboard/commerce/Customers.tsx index cbb07da..57682b0 100644 --- a/src/pages/dashboard/commerce/Customers.tsx +++ b/src/pages/dashboard/commerce/Customers.tsx @@ -127,7 +127,7 @@ const Customers = () => {
{customer.firstName} {customer.lastName} -

Cliente desde {customer.createdAt}

+

{t('customerSince')} {customer.createdAt}

)}
- Total compras: + {t('totalPurchases')}:
{customer.totalPurchases || 0} diff --git a/src/pages/dashboard/commerce/Inventory.tsx b/src/pages/dashboard/commerce/Inventory.tsx index 0c77821..c00db85 100644 --- a/src/pages/dashboard/commerce/Inventory.tsx +++ b/src/pages/dashboard/commerce/Inventory.tsx @@ -25,7 +25,7 @@ const Inventory = () => { const handleSubmit = async () => { try { - toast({ title: 'Γ‰xito', description: 'Producto agregado al inventario' }); + toast({ title: t('success'), description: t('add') }); setFormData({ name: '', category: '', @@ -35,7 +35,7 @@ const Inventory = () => { supplier: '' }); } catch (error: any) { - toast({ title: 'Error', description: error?.message || 'No se pudo agregar el producto', variant: 'destructive' }); + toast({ title: t('error'), description: error?.message || t('error'), variant: 'destructive' }); } }; diff --git a/src/pages/dashboard/commerce/POSTerminal.tsx b/src/pages/dashboard/commerce/POSTerminal.tsx index fd829f3..971d656 100644 --- a/src/pages/dashboard/commerce/POSTerminal.tsx +++ b/src/pages/dashboard/commerce/POSTerminal.tsx @@ -7,9 +7,11 @@ import { Badge } from '@/components/ui/badge'; import { useToast } from '@/hooks/use-toast'; import { apiClient } from '@/services/adminApi'; import { useLanguage } from '@/contexts/LanguageContext'; +import { useCurrency } from '@/contexts/CurrencyContext'; const POSTerminal = () => { const { t } = useLanguage(); + const { formatAmount } = useCurrency(); const [products, setProducts] = useState([]); const [cart, setCart] = useState([]); const [searchTerm, setSearchTerm] = useState(''); @@ -23,7 +25,11 @@ const POSTerminal = () => { try { // Load inventory products for POS // For now using mock data - setProducts([]); + const mock = [ + { id: 1, name: 'T-Shirt', category: 'Apparel', price: 20, stock: 15, barcode: '123456' }, + { id: 2, name: 'Mug', category: 'Gifts', price: 8.5, stock: 40, barcode: '789012' }, + ].map(p => ({ ...p, formattedPrice: formatAmount(p.price) })); + setProducts(mock); } catch (error) { console.error('Error loading products:', error); } @@ -120,10 +126,10 @@ const POSTerminal = () => { {item.barcode}
)} -
- {item.category} - ${item.price} -
+
+ {item.category} + {item.formattedPrice || `$${item.price}`} +

{t('stock')}: {item.stock}

@@ -150,7 +156,7 @@ const POSTerminal = () => {

{item.name}

-

${item.price}

+

{item.formattedPrice || `$${item.price}`}