feat: wire remaining dashboard pages to i18n (pass 2+3)
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useT } from "@/lib/i18n";
|
||||
|
||||
export function BrandTrackerActions({ brandPageId, trackingId }: { brandPageId: string; trackingId?: string }) {
|
||||
const router = useRouter();
|
||||
const t = useT();
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
@@ -21,7 +23,7 @@ export function BrandTrackerActions({ brandPageId, trackingId }: { brandPageId:
|
||||
if (!response.ok) throw new Error(data.error || "BRAND_TRACKER_FAILED");
|
||||
router.refresh();
|
||||
} catch (caught) {
|
||||
setError(caught instanceof Error ? caught.message : "İşlem başarısız oldu.");
|
||||
setError(caught instanceof Error ? caught.message : t("common.error"));
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
@@ -35,7 +37,7 @@ export function BrandTrackerActions({ brandPageId, trackingId }: { brandPageId:
|
||||
disabled={busy}
|
||||
className={`rounded-xl px-4 py-2 text-sm font-black disabled:opacity-50 ${trackingId ? "bg-slate-100 text-slate-700" : "bg-violet-700 text-white"}`}
|
||||
>
|
||||
{busy ? "İşleniyor…" : trackingId ? "Takibi bırak" : "Markayı takip et"}
|
||||
{busy ? t("common.loading") : trackingId ? t("brand.untrack") : t("brand.track")}
|
||||
</button>
|
||||
{error && <div className="mt-1 max-w-48 text-xs font-semibold text-rose-600">{error}</div>}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user