help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
chatgpt-web-interface
/
src
/
components
RSK World
chatgpt-web-interface
ChatGPT Web Interface - GPT-3 + GPT-4 + ChatGPT + React + JavaScript + Web Interface
components
  • ChatInterface.js5.2 KB
  • InputArea.js1.4 KB
  • Message.js4.8 KB
  • MessageList.js1.5 KB
  • SettingsPanel.js3.7 KB
  • Sidebar.js2.5 KB
  • SidebarEnhanced.js6.2 KB
Sidebar.js
src/components/Sidebar.js
Raw Download
Find: Go to:
/*
Project: ChatGPT Web Interface
Developer: Molla Samser
Email: help@rskworld.in
Phone: +91 93305 39277
Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
Website: https://rskworld.in/
Year: 2026
*/

import React from 'react';

function Sidebar({ conversations, currentConversationId, onSelectConversation, onNewConversation, onDeleteConversation, isOpen, onToggle }) {
  const handleDelete = (e, id) => {
    e.stopPropagation();
    if (window.confirm('Are you sure you want to delete this conversation?')) {
      onDeleteConversation(id);
    }
  };

  return (
    <>
      {isOpen && <div className="sidebar-overlay" onClick={onToggle}></div>}
      <aside className={`sidebar ${isOpen ? 'open' : ''}`}>
        <div className="sidebar-header">
          <button className="new-chat-button" onClick={onNewConversation}>
            <i className="fas fa-plus"></i>
            New Chat
          </button>
          <button className="sidebar-close" onClick={onToggle}>
            <i className="fas fa-times"></i>
          </button>
        </div>
        <div className="conversation-list">
          {conversations.length === 0 ? (
            <div className="empty-conversations">
              <p>No conversations yet. Start a new chat!</p>
            </div>
          ) : (
            conversations.map(conv => (
              <div
                key={conv.id}
                className={`conversation-item ${currentConversationId === conv.id ? 'active' : ''}`}
                onClick={() => onSelectConversation(conv.id)}
              >
                <div className="conversation-title">
                  <i className="fas fa-comment"></i>
                  <span>{conv.title}</span>
                </div>
                <button
                  className="delete-conversation"
                  onClick={(e) => handleDelete(e, conv.id)}
                  title="Delete conversation"
                >
                  <i className="fas fa-trash"></i>
                </button>
              </div>
            ))
          )}
        </div>
        <div className="sidebar-footer">
          <div className="footer-info">
            <p>ChatGPT Web Interface</p>
            <p className="footer-link">
              <a href="https://rskworld.in/" target="_blank" rel="noopener noreferrer">
                rskworld.in
              </a>
            </p>
          </div>
        </div>
      </aside>
    </>
  );
}

export default Sidebar;

78 lines•2.5 KB
javascript

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer