From ec7cb18928c7850c3e22a1daa30cb40e563f53da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 9 Mar 2026 16:29:41 -0300 Subject: [PATCH] feat: customize search placeholder based on user role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agents see 'Buscar atendimentos...' - Super admins see 'Buscar membros, equipes, atendimentos ou organizações...' - Admin and managers see 'Buscar membros, equipes ou atendimentos...' --- components/Layout.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/Layout.tsx b/components/Layout.tsx index d4910f7..5d9b7e2 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -53,6 +53,12 @@ export const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => return () => clearTimeout(delayDebounceFn); }, [searchQuery]); + const getSearchPlaceholder = () => { + if (currentUser?.role === 'super_admin') return 'Buscar membros, equipes, atendimentos ou organizações...'; + if (currentUser?.role === 'agent') return 'Buscar atendimentos...'; + return 'Buscar membros, equipes ou atendimentos...'; + }; + useEffect(() => { const fetchCurrentUser = async () => { const storedUserId = localStorage.getItem('ctms_user_id'); @@ -207,7 +213,7 @@ export const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {isSearching ? : } setSearchQuery(e.target.value)} onFocus={() => searchQuery.length >= 2 && setShowSearchResults(true)}