LibreChat/client/src/components/Nav/SettingsTabs/Chat/ChatDirection.tsx
Marco Beretta 2d62eca612
👐 style: Improve a11y/theming for Settings Dialog, Dropdown Menus; fix: SearchBar focus issues (#4091)
* fix: cursor pointer not applying correct in the root component

* fix: add cursor-not-allowed to disabled state in SendButton component

* feat: update Dropdown to ariakit and changed LLM error's style

* feat: switched to ariakit's Dropdown and style improvements

* feat: archive updates

* refactor: delete conversations in archive

* refactor: settings

* add cool settings animation

* a11y: settings update

* style: update settings

* style: settings account settings menu; a11y(AccountSettings): switched to AriaKit

* a11y: account settings update

* style: update my files dialog

* fix: tests

* chore: remove console.log()

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2024-09-21 22:45:50 -04:00

37 lines
1.1 KiB
TypeScript

import React from 'react';
import { useRecoilState } from 'recoil';
import { useLocalize } from '~/hooks';
import { Button } from '~/components';
import store from '~/store';
const ChatDirection = () => {
const [direction, setDirection] = useRecoilState(store.chatDirection);
const localize = useLocalize();
const toggleChatDirection = () => {
setDirection((prev) => (prev === 'LTR' ? 'RTL' : 'LTR'));
};
return (
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<span id="chat-direction-label">{localize('com_nav_chat_direction')}</span>
</div>
<Button
variant="outline"
aria-label="Toggle chat direction"
onClick={toggleChatDirection}
data-testid="chatDirection"
>
<span aria-hidden="true">{direction.toLowerCase()}</span>
<span id="chat-direction-status" className="sr-only">
{direction === 'LTR'
? localize('chat_direction_left_to_right')
: localize('chat_direction_right_to_left')}
</span>
</Button>
</div>
);
};
export default ChatDirection;