// Configuration - uses build-time environment variables
export const config = {
  VITE_API_URL: import.meta.env.VITE_API_URL || '/api',
  VITE_APP_TITLE: import.meta.env.VITE_APP_TITLE || 'BakeWise',
  VITE_APP_VERSION: import.meta.env.VITE_APP_VERSION || '1.0.0',
  VITE_OTEL_ENABLED: import.meta.env.VITE_OTEL_ENABLED || 'true',
  VITE_OTEL_TRACES_ENDPOINT: import.meta.env.VITE_OTEL_TRACES_ENDPOINT || '/api/v1/telemetry/v1/traces',
  VITE_OTEL_METRICS_ENDPOINT: import.meta.env.VITE_OTEL_METRICS_ENDPOINT || '/api/v1/telemetry/v1/metrics',
};

export function getApiUrl(): string {
  return config.VITE_API_URL;
}

export function getAppTitle(): string {
  return config.VITE_APP_TITLE;
}

export function getAppVersion(): string {
  return config.VITE_APP_VERSION;
}

export function isOpenTelemetryEnabled(): boolean {
  return config.VITE_OTEL_ENABLED?.toLowerCase() !== 'false';
}

export function getOtelTracesEndpoint(): string {
  return config.VITE_OTEL_TRACES_ENDPOINT;
}

export function getOtelMetricsEndpoint(): string {
  return config.VITE_OTEL_METRICS_ENDPOINT;
}
