feat: enhance SEO for listing and specialty pages, fix search autocomplete issue

This commit is contained in:
hamed
2026-07-20 10:26:03 +03:30
parent 9011b230b3
commit 30c3fe8637
14 changed files with 460 additions and 69 deletions
@@ -24,7 +24,9 @@ function AutoCompleteSearch({
<Autocomplete
freeSolo
options={data}
getOptionLabel={(option) => option.name}
getOptionLabel={(option) =>
typeof option === "string" ? option : (option?.name ?? "")
}
inputValue={inputValue}
className="!w-full"
onInputChange={(_, newInputValue) => {
@@ -33,7 +35,10 @@ function AutoCompleteSearch({
}}
onChange={(_, newValue) => {
setSelectedOption && setSelectedOption(newValue);
handleSearch(newValue ? newValue.name : "");
// freeSolo: مقدار تأییدشده می‌تواند رشتهٔ تایپ‌شده باشد، نه گزینهٔ لیست.
handleSearch(
typeof newValue === "string" ? newValue : (newValue?.name ?? "")
);
}}
componentsProps={clearIndicatorProps}
renderOption={(props, option) => (