LibreChat/client/src/components/Nav/SettingsTabs/Account/DisplayUsernameMessages.tsx
Marco Beretta f70a62793b
refactor: remove GenericManagePermissionsDialog and GrantAccessDialog components
- Deleted GenericManagePermissionsDialog and GrantAccessDialog components to streamline sharing functionality.
- Updated ManagePermissionsDialog to utilize AccessRolesPicker directly.
- Introduced UnifiedPeopleSearch for improved people selection experience.
- Enhanced PublicSharingToggle with InfoHoverCard for better user guidance.
- Adjusted AgentPanel to change error status to warning for duplicate agent versions.
- Updated translations to include new keys for search and access management.
2025-08-05 23:01:24 +02:00

30 lines
1,004 B
TypeScript

import React from 'react';
import { useRecoilState } from 'recoil';
import { Switch, Label, InfoHoverCard, ESide } from '@librechat/client';
import { useLocalize } from '~/hooks';
import store from '~/store';
export default function DisplayUsernameMessages() {
const localize = useLocalize();
const [UsernameDisplay, setUsernameDisplay] = useRecoilState(store.UsernameDisplay);
const handleCheckedChange = (checked: boolean) => {
setUsernameDisplay(checked);
};
return (
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<Label className="font-light">{localize('com_nav_user_name_display')}</Label>
<InfoHoverCard side={ESide.Bottom} text={localize('com_nav_info_user_name_display')} />
</div>
<Switch
id="UsernameDisplay"
checked={UsernameDisplay}
onCheckedChange={handleCheckedChange}
className="ml-4"
data-testid="UsernameDisplay"
/>
</div>
);
}