'use client';

import { useAtomValue } from 'jotai';
import { isPhoneCallModeAtom } from './atoms';
import ChatMode from './ChatMode';
import './index.css';
import PhoneCallMode from './PhoneCallMode';
import ChatContextProvider from './Context';

export default function CharacterChat() {
  const isPhoneCallMode = useAtomValue(isPhoneCallModeAtom);

  return (
    <ChatContextProvider>
      <div
        style={{
          background:
            'linear-gradient(0deg, rgba(23, 0, 18, 0.6) 0%, rgba(0, 0, 0, 0.1) 100%)',
        }}
        className="relative flex h-full w-full justify-center overflow-hidden"
      >
        {isPhoneCallMode ? <PhoneCallMode /> : <ChatMode />}
      </div>
    </ChatContextProvider>
  );
}
