feat: translate clients/players page to English
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,9 +66,9 @@ interface MembershipPlan {
|
||||
}
|
||||
|
||||
const membershipFilters = [
|
||||
{ value: "", label: "Todos" },
|
||||
{ value: "with", label: "Con membresia" },
|
||||
{ value: "without", label: "Sin membresia" },
|
||||
{ value: "", label: "All" },
|
||||
{ value: "with", label: "With membership" },
|
||||
{ value: "without", label: "Without membership" },
|
||||
];
|
||||
|
||||
const ITEMS_PER_PAGE = 10;
|
||||
@@ -112,7 +112,7 @@ export default function ClientsPage() {
|
||||
params.append("offset", ((currentPage - 1) * ITEMS_PER_PAGE).toString());
|
||||
|
||||
const response = await fetch(`/api/clients?${params.toString()}`);
|
||||
if (!response.ok) throw new Error("Error al cargar clientes");
|
||||
if (!response.ok) throw new Error("Error loading players");
|
||||
|
||||
const data: ClientsResponse = await response.json();
|
||||
|
||||
@@ -138,7 +138,7 @@ export default function ClientsPage() {
|
||||
setTotalClients(data.pagination.total);
|
||||
} catch (err) {
|
||||
console.error("Error fetching clients:", err);
|
||||
setError(err instanceof Error ? err.message : "Error desconocido");
|
||||
setError(err instanceof Error ? err.message : "Unknown error");
|
||||
} finally {
|
||||
setLoadingClients(false);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export default function ClientsPage() {
|
||||
try {
|
||||
// Fetch all clients to calculate stats
|
||||
const response = await fetch("/api/clients?limit=1000");
|
||||
if (!response.ok) throw new Error("Error al cargar estadisticas");
|
||||
if (!response.ok) throw new Error("Error loading statistics");
|
||||
|
||||
const data: ClientsResponse = await response.json();
|
||||
const allClients = data.data;
|
||||
@@ -186,7 +186,7 @@ export default function ClientsPage() {
|
||||
const fetchMembershipPlans = useCallback(async () => {
|
||||
try {
|
||||
const response = await fetch("/api/membership-plans");
|
||||
if (!response.ok) throw new Error("Error al cargar planes");
|
||||
if (!response.ok) throw new Error("Error loading plans");
|
||||
const data = await response.json();
|
||||
setMembershipPlans(data.filter((p: MembershipPlan & { isActive?: boolean }) => p.isActive !== false));
|
||||
} catch (err) {
|
||||
@@ -198,12 +198,12 @@ export default function ClientsPage() {
|
||||
const fetchClientDetails = async (clientId: string) => {
|
||||
try {
|
||||
const response = await fetch(`/api/clients/${clientId}`);
|
||||
if (!response.ok) throw new Error("Error al cargar detalles del cliente");
|
||||
if (!response.ok) throw new Error("Error loading player details");
|
||||
const data = await response.json();
|
||||
setSelectedClient(data);
|
||||
} catch (err) {
|
||||
console.error("Error fetching client details:", err);
|
||||
setError(err instanceof Error ? err.message : "Error desconocido");
|
||||
setError(err instanceof Error ? err.message : "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -244,7 +244,7 @@ export default function ClientsPage() {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData.error || "Error al crear cliente");
|
||||
throw new Error(errorData.error || "Error creating player");
|
||||
}
|
||||
|
||||
setShowCreateForm(false);
|
||||
@@ -276,7 +276,7 @@ export default function ClientsPage() {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData.error || "Error al actualizar cliente");
|
||||
throw new Error(errorData.error || "Error updating player");
|
||||
}
|
||||
|
||||
setEditingClient(null);
|
||||
@@ -297,7 +297,7 @@ export default function ClientsPage() {
|
||||
const handleDeleteClient = async (client: Client) => {
|
||||
if (
|
||||
!confirm(
|
||||
`¿Estas seguro de desactivar a ${client.firstName} ${client.lastName}?`
|
||||
`Are you sure you want to deactivate ${client.firstName} ${client.lastName}?`
|
||||
)
|
||||
) {
|
||||
return;
|
||||
@@ -310,13 +310,13 @@ export default function ClientsPage() {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData.error || "Error al desactivar cliente");
|
||||
throw new Error(errorData.error || "Error deactivating player");
|
||||
}
|
||||
|
||||
await Promise.all([fetchClients(), fetchStats()]);
|
||||
} catch (err) {
|
||||
console.error("Error deleting client:", err);
|
||||
setError(err instanceof Error ? err.message : "Error desconocido");
|
||||
setError(err instanceof Error ? err.message : "Unknown error");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -337,7 +337,7 @@ export default function ClientsPage() {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData.error || "Error al asignar membresia");
|
||||
throw new Error(errorData.error || "Error assigning membership");
|
||||
}
|
||||
|
||||
setShowAssignMembership(false);
|
||||
@@ -367,9 +367,9 @@ export default function ClientsPage() {
|
||||
{/* Header */}
|
||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-primary-800">Clientes</h1>
|
||||
<h1 className="text-2xl font-bold text-primary-800">Players</h1>
|
||||
<p className="mt-1 text-primary-600">
|
||||
Gestiona los clientes de tu centro
|
||||
Manage your club's players
|
||||
</p>
|
||||
</div>
|
||||
<Button onClick={() => setShowCreateForm(true)}>
|
||||
@@ -386,7 +386,7 @@ export default function ClientsPage() {
|
||||
d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"
|
||||
/>
|
||||
</svg>
|
||||
Nuevo Cliente
|
||||
New Player
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -433,7 +433,7 @@ export default function ClientsPage() {
|
||||
) : (
|
||||
<>
|
||||
<StatCard
|
||||
title="Total Clientes"
|
||||
title="Total Players"
|
||||
value={stats.totalClients}
|
||||
color="primary"
|
||||
icon={
|
||||
@@ -453,7 +453,7 @@ export default function ClientsPage() {
|
||||
}
|
||||
/>
|
||||
<StatCard
|
||||
title="Con Membresia"
|
||||
title="With Membership"
|
||||
value={stats.withMembership}
|
||||
color="accent"
|
||||
icon={
|
||||
@@ -473,7 +473,7 @@ export default function ClientsPage() {
|
||||
}
|
||||
/>
|
||||
<StatCard
|
||||
title="Nuevos Este Mes"
|
||||
title="New This Month"
|
||||
value={stats.newThisMonth}
|
||||
color="green"
|
||||
icon={
|
||||
@@ -504,7 +504,7 @@ export default function ClientsPage() {
|
||||
<div className="flex-1">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="Buscar por nombre, email o telefono..."
|
||||
placeholder="Search by name, email or phone..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full"
|
||||
|
||||
Reference in New Issue
Block a user