mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
refactor(client): convert ClearConvos component from jsx to tsx
refactor(client): convert Dialog, DialogButton, Input, Label, Checkbox, and DialogTemplate components from jsx to tsx refactor(client): export ClearChatsButton component from General.tsx refactor(client): add useCallback hook to moveToTop function in Nav component
This commit is contained in:
parent
c661276888
commit
931a89204c
6 changed files with 50 additions and 53 deletions
|
|
@ -19,9 +19,9 @@ const ThemeSelector = ({ theme, onChange }: { theme: string, onChange: (value: s
|
|||
</div>
|
||||
);
|
||||
|
||||
const ClearChatsButton = ({ confirmClear, onClick }: { confirmClear: boolean, onClick: () => void }) => (
|
||||
export const ClearChatsButton = ({ confirmClear, showText = true, onClick }: { confirmClear: boolean, showText: boolean, onClick: () => void }) => (
|
||||
<div className="flex items-center justify-between">
|
||||
<div>Clear all chats</div>
|
||||
{showText && <div>Clear all chats</div>}
|
||||
<button
|
||||
className="btn relative bg-red-600 text-white hover:bg-red-800"
|
||||
type="button"
|
||||
|
|
@ -67,7 +67,7 @@ function General() {
|
|||
<ThemeSelector theme={theme} onChange={changeTheme} />
|
||||
</div>
|
||||
<div className="border-b pb-3 last-of-type:border-b-0 dark:border-gray-700">
|
||||
<ClearChatsButton confirmClear={confirmClear} onClick={clearConvos} />
|
||||
<ClearChatsButton confirmClear={confirmClear} onClick={clearConvos} showText={true}/>
|
||||
</div>
|
||||
</div>
|
||||
</Tabs.Content>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue