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

1005 B
Raw Blame
import type { ReactNode } from 'react';
import { cn } from '~/utils';

interface SectionProps {
  heading: string;
  icon?: ReactNode;
  danger?: boolean;
  children: ReactNode;
}

export default function Section({ heading, icon, danger, children }: SectionProps) {
  return (
    <section className="mb-7">
      <h3
        className={cn(
          'mb-1 flex items-center gap-1.5 px-1 text-xs font-medium tracking-wide uppercase',
          danger ? 'text-text-destructive' : 'text-text-secondary',
        )}
      >
        {icon}
        {heading}
      </h3>
      {/* A section is a group, not a card: spacing and the label above carry the
          grouping. The destructive section keeps its edge, where the box is the
          warning rather than decoration. */}
      <div
        className={cn(
          'text-text-primary overflow-hidden rounded-xl text-sm',
          danger && 'border-status-error-border border',
        )}
      >
        {children}
      </div>
    </section>
  );
}