diff --git a/apps/frontend-mobile/components/SearchBar.tsx b/apps/frontend-mobile/components/SearchBar.tsx index 73553d1..02038ed 100644 --- a/apps/frontend-mobile/components/SearchBar.tsx +++ b/apps/frontend-mobile/components/SearchBar.tsx @@ -1,8 +1,10 @@ import React, { useState } from 'react'; -import { View, TextInput, StyleSheet, TouchableOpacity } from 'react-native'; +import { View, TextInput, StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { colors, spacing, borderRadius } from '../constants/theme'; +const TABLET_MIN_WIDTH = 768; + interface SearchBarProps { placeholder?: string; onSearch: (query: string) => void; @@ -10,12 +12,14 @@ interface SearchBarProps { onChangeText?: (text: string) => void; } -export function SearchBar({ - placeholder = 'Buscar medicamentos...', +export function SearchBar({ + placeholder = 'Buscar medicamentos...', onSearch, value, - onChangeText + onChangeText }: SearchBarProps) { + const { width } = useWindowDimensions(); + const isTablet = width >= TABLET_MIN_WIDTH; const [localValue, setLocalValue] = useState(value || ''); const handleChange = (text: string) => { @@ -34,10 +38,10 @@ export function SearchBar({ }; return ( - +