Extend Filter.tsx to cover locale-specific numbers, too

This commit is contained in:
0x1eef 2024-06-11 16:16:14 -03:00
parent f71a89a0f7
commit 3b0e06885c

View file

@ -1,5 +1,5 @@
import React from "react";
import { TFunction } from "~/lib/t";
import { TFunction, formatNumber } from "~/lib/t";
import type { Surah, TLocale } from "Quran";
type Props = {
@ -22,7 +22,8 @@ export function Filter({ locale, t, setIndex, surahs }: Props) {
surah =>
regexp.test(surah.name) ||
regexp.test(surah.roman.name) ||
regexp.test(String(surah.id)),
regexp.test(String(surah.id)) ||
regexp.test(formatNumber(locale, surah.id))
);
setIndex(newIndex);
}