mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 21:02:40 +02:00
refactor: update ConnectToolsBanner to accept isThreadEmpty prop and adjust visibility logic; modify 'no_chats' message across multiple languages
This commit is contained in:
parent
68f1a7c5ce
commit
bad3eb695f
6 changed files with 8 additions and 8 deletions
|
|
@ -262,7 +262,7 @@ const BANNER_CONNECTORS = [
|
||||||
|
|
||||||
const BANNER_DISMISSED_KEY = "surfsense-connect-tools-banner-dismissed";
|
const BANNER_DISMISSED_KEY = "surfsense-connect-tools-banner-dismissed";
|
||||||
|
|
||||||
const ConnectToolsBanner: FC = () => {
|
const ConnectToolsBanner: FC<{ isThreadEmpty: boolean }> = ({ isThreadEmpty }) => {
|
||||||
const { data: connectors } = useAtomValue(connectorsAtom);
|
const { data: connectors } = useAtomValue(connectorsAtom);
|
||||||
const setConnectorDialogOpen = useSetAtom(connectorDialogOpenAtom);
|
const setConnectorDialogOpen = useSetAtom(connectorDialogOpenAtom);
|
||||||
const [dismissed, setDismissed] = useState(() => {
|
const [dismissed, setDismissed] = useState(() => {
|
||||||
|
|
@ -272,7 +272,7 @@ const ConnectToolsBanner: FC = () => {
|
||||||
|
|
||||||
const hasConnectors = (connectors?.length ?? 0) > 0;
|
const hasConnectors = (connectors?.length ?? 0) > 0;
|
||||||
|
|
||||||
if (dismissed || hasConnectors) return null;
|
if (dismissed || hasConnectors || !isThreadEmpty) return null;
|
||||||
|
|
||||||
const handleDismiss = (e: React.MouseEvent) => {
|
const handleDismiss = (e: React.MouseEvent) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
@ -566,7 +566,7 @@ const Composer: FC = () => {
|
||||||
)}
|
)}
|
||||||
<ComposerAction isBlockedByOtherUser={isBlockedByOtherUser} />
|
<ComposerAction isBlockedByOtherUser={isBlockedByOtherUser} />
|
||||||
<ConnectorIndicator showTrigger={false} />
|
<ConnectorIndicator showTrigger={false} />
|
||||||
<ConnectToolsBanner />
|
<ConnectToolsBanner isThreadEmpty={isThreadEmpty} />
|
||||||
</div>
|
</div>
|
||||||
</ComposerPrimitive.Root>
|
</ComposerPrimitive.Root>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@
|
||||||
"view_all_private_chats": "View all private chats",
|
"view_all_private_chats": "View all private chats",
|
||||||
"show_all": "Show all",
|
"show_all": "Show all",
|
||||||
"hide": "Hide",
|
"hide": "Hide",
|
||||||
"no_chats": "No chats yet",
|
"no_chats": "No chats",
|
||||||
"start_new_chat_hint": "Start a new chat",
|
"start_new_chat_hint": "Start a new chat",
|
||||||
"error_loading_chats": "Error loading chats",
|
"error_loading_chats": "Error loading chats",
|
||||||
"chat_deleted": "Chat deleted successfully",
|
"chat_deleted": "Chat deleted successfully",
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@
|
||||||
"view_all_private_chats": "Ver todos los chats privados",
|
"view_all_private_chats": "Ver todos los chats privados",
|
||||||
"show_all": "Ver todo",
|
"show_all": "Ver todo",
|
||||||
"hide": "Ocultar",
|
"hide": "Ocultar",
|
||||||
"no_chats": "Aún no hay chats",
|
"no_chats": "Sin chats",
|
||||||
"start_new_chat_hint": "Iniciar un nuevo chat",
|
"start_new_chat_hint": "Iniciar un nuevo chat",
|
||||||
"error_loading_chats": "Error al cargar chats",
|
"error_loading_chats": "Error al cargar chats",
|
||||||
"chat_deleted": "Chat eliminado correctamente",
|
"chat_deleted": "Chat eliminado correctamente",
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@
|
||||||
"view_all_private_chats": "सभी निजी चैट देखें",
|
"view_all_private_chats": "सभी निजी चैट देखें",
|
||||||
"show_all": "सभी देखें",
|
"show_all": "सभी देखें",
|
||||||
"hide": "छिपाएँ",
|
"hide": "छिपाएँ",
|
||||||
"no_chats": "अभी तक कोई चैट नहीं",
|
"no_chats": "कोई चैट नहीं",
|
||||||
"start_new_chat_hint": "नई चैट शुरू करें",
|
"start_new_chat_hint": "नई चैट शुरू करें",
|
||||||
"error_loading_chats": "चैट लोड करने में त्रुटि",
|
"error_loading_chats": "चैट लोड करने में त्रुटि",
|
||||||
"chat_deleted": "चैट सफलतापूर्वक हटाया गया",
|
"chat_deleted": "चैट सफलतापूर्वक हटाया गया",
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@
|
||||||
"view_all_private_chats": "Ver todos os chats privados",
|
"view_all_private_chats": "Ver todos os chats privados",
|
||||||
"show_all": "Ver tudo",
|
"show_all": "Ver tudo",
|
||||||
"hide": "Ocultar",
|
"hide": "Ocultar",
|
||||||
"no_chats": "Nenhum chat ainda",
|
"no_chats": "Nenhum chat",
|
||||||
"start_new_chat_hint": "Iniciar um novo chat",
|
"start_new_chat_hint": "Iniciar um novo chat",
|
||||||
"error_loading_chats": "Erro ao carregar chats",
|
"error_loading_chats": "Erro ao carregar chats",
|
||||||
"chat_deleted": "Chat excluído com sucesso",
|
"chat_deleted": "Chat excluído com sucesso",
|
||||||
|
|
|
||||||
|
|
@ -640,7 +640,7 @@
|
||||||
"view_all_private_chats": "查看所有私人对话",
|
"view_all_private_chats": "查看所有私人对话",
|
||||||
"show_all": "查看全部",
|
"show_all": "查看全部",
|
||||||
"hide": "隐藏",
|
"hide": "隐藏",
|
||||||
"no_chats": "暂无对话",
|
"no_chats": "无对话",
|
||||||
"start_new_chat_hint": "开始新对话",
|
"start_new_chat_hint": "开始新对话",
|
||||||
"error_loading_chats": "加载对话时出错",
|
"error_loading_chats": "加载对话时出错",
|
||||||
"chat_deleted": "对话删除成功",
|
"chat_deleted": "对话删除成功",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue