"use client";

import { useEffect } from "react";
import type { Language } from "@/data/portfolio";

type DocumentLanguageSyncProps = {
  language: Language;
  dir: "ltr" | "rtl";
};

export function DocumentLanguageSync({
  language,
  dir,
}: DocumentLanguageSyncProps) {
  useEffect(() => {
    document.documentElement.lang = language;
    document.documentElement.dir = dir;
  }, [dir, language]);

  return null;
}
