Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

638 B
Raw Blame
import { useMediaQuery, useRemScale } from '@librechat/client';
import { scaledMaxWidthQuery } from '~/utils/breakpoints';

/**
 * Whether the viewport is at most `baselinePx` wide, measured in the units the layout is
 * expressed in. Use this rather than a fixed pixel query wherever the branch chooses
 * between a wide and a narrow layout: at a larger scale the wide one keeps being picked
 * while its rem-sized contents outgrow the space it gives them.
 */
export default function useScaledMaxWidth(baselinePx: number): boolean {
  const remScale = useRemScale();
  return useMediaQuery(scaledMaxWidthQuery(baselinePx, remScale));
}