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.2 KB
Raw Blame
import { useLocalize } from '@librechat/client';

export default function RemoveFile({
  onRemove,
  label,
  disabled = false,
}: {
  onRemove: () => void;
  disabled?: boolean;
  /** Names the file, where several chips sit side by side and "Remove file" would not say which. */
  label?: string;
}): React.JSX.Element {
  const localize = useLocalize();
  return (
    <button
      type="button"
      data-remove-file
      className="bg-surface-secondary hover:bg-surface-primary absolute inset-e-1 top-1 translate-x-1/2 -translate-y-1/2 rounded-full p-0.5 transition-colors duration-200 rtl:-translate-x-1/2"
      onClick={onRemove}
      disabled={disabled}
      aria-label={label ?? localize('com_ui_attach_remove')}
    >
      <span aria-hidden="true">
        <svg
          stroke="currentColor"
          fill="none"
          strokeWidth="2"
          viewBox="0 0 24 24"
          strokeLinecap="round"
          strokeLinejoin="round"
          className="icon-sm"
          xmlns="http://www.w3.org/2000/svg"
          width="32"
          height="32"
        >
          <line x1="18" y1="6" x2="6" y2="18" />
          <line x1="6" y1="6" x2="18" y2="18" />
        </svg>
      </span>
    </button>
  );
}