#!/bin/bash

# Script to add dir="auto" to all input and textarea elements
# This enables automatic RTL/LTR detection for mixed content

find ./src -name "*.jsx" -type f -exec sed -i 's/<input\([^>]*\)\(type="text"\|type="email"\|type="url"\|type="search"\)\([^>]*\)>/<input\1\2\3 dir="auto">/g' {} \;
find ./src -name "*.jsx" -type f -exec sed -i 's/<textarea\([^>]*\)>/<textarea\1 dir="auto">/g' {} \;

echo "Updated all text inputs and textareas with dir='auto'"
