const DEFAULT_ACCENT = "#FF5C2B";

function readAccentFromLocation() {
  if (typeof window === "undefined") return DEFAULT_ACCENT;
  const value = new URLSearchParams(window.location.search).get("accent");
  return /^#[0-9A-Fa-f]{6}$/.test(value || "") ? value : DEFAULT_ACCENT;
}

function AppB() {
  const [accent] = React.useState(readAccentFromLocation);
  return <DirectionB accent={accent} />;
}

ReactDOM.createRoot(document.getElementById("root")).render(<AppB />);
