Arabic Text.jsx -

const ArabicText = ( children, ...props ) => const fontLoaded = useArabicFont();

return ( <div dir=isRTL ? 'rtl' : 'ltr'> <ArabicText> t('welcome_message') </ArabicText> </div> ); Arabic Text.jsx

const styles = ;

export default ArabicText; /* components/ArabicText.css */ .arabic-text display: inline-block; font-family: 'Segoe UI', 'Tahoma', 'Noto Sans Arabic', 'Amiri', 'Droid Arabic Naskh', 'Traditional Arabic', sans-serif; unicode-bidi: embed; word-wrap: break-word; white-space: normal; const ArabicText = ( children,

return ( <span dir="rtl" lang="ar" style= opacity: fontLoaded ? 1 : 0.99 ...props > children </span> ); ; Basic Usage import ArabicText from './components/ArabicText'; function App() return ( <div> <ArabicText>مرحبا بالعالم</ArabicText> <ArabicText size="large" weight="bold"> عنوان رئيسي </ArabicText> </div> ); convertToArabicNumerals(children) : children

const formattedContent = useArabicNumerals ? convertToArabicNumerals(children) : children;

useEffect(() => // Check if Arabic font is supported const checkFont = async () => if ('fonts' in document) await document.fonts.ready; setFontLoaded(true);