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

1.5 KB
Raw Blame
import { Skeleton } from '@librechat/client';
import { useLocalize } from '~/hooks';

const SKELETON_ROWS = 3;
const HEADER_KEYS = ['com_ui_name', 'com_ui_method', 'com_ui_path'] as const;

/**
 * Loading state for the actions table. Mirrors the table's chrome (eyebrow header,
 * row dividers, a badge-shaped method cell) so the swap to real rows doesn't shift
 * the layout. The headers are real since they never change.
 */
export default function ActionsTableSkeleton() {
  const localize = useLocalize();
  return (
    <table className="w-full table-auto text-sm" aria-busy="true" aria-live="polite">
      <thead>
        <tr className="border-border-light border-b">
          {HEADER_KEYS.map((key) => (
            <th
              key={key}
              className="text-text-secondary text-2xs py-2 pe-3 text-start font-medium tracking-wide uppercase"
            >
              {localize(key)}
            </th>
          ))}
        </tr>
      </thead>
      <tbody>
        {Array.from({ length: SKELETON_ROWS }, (_, row) => (
          <tr key={row} className="border-border-light border-b last:border-0">
            <td className="py-2.5 pe-3">
              <Skeleton className="h-4 w-24 rounded" />
            </td>
            <td className="py-2.5 pe-3">
              <Skeleton className="h-5 w-12 rounded-md" />
            </td>
            <td className="py-2.5 pe-3">
              <Skeleton className="h-4 w-32 rounded" />
            </td>
          </tr>
        ))}
      </tbody>
    </table>
  );
}