import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

createRoot(document.getElementById("root")!).render(<App />);

// Core Web Vitals reporting
import { onCLS, onINP, onLCP, onFCP, onTTFB } from "web-vitals";

const reportWebVitals = (metric: { name: string; value: number; rating: string }) => {
  // Log in development, can send to analytics in production
  if (import.meta.env.DEV) {
    console.log(`[Web Vitals] ${metric.name}: ${metric.value.toFixed(2)} (${metric.rating})`);
  }
};

onCLS(reportWebVitals);
onINP(reportWebVitals);
onLCP(reportWebVitals);
onFCP(reportWebVitals);
onTTFB(reportWebVitals);
