updates on the api integration and the design changes on the whole website

This commit is contained in:
2026-08-11 11:18:40 +05:30
parent d144ff71a9
commit bf28249528
48 changed files with 2888 additions and 6361 deletions

View File

@@ -12,6 +12,7 @@ import { fetchAppLocations } from 'pages/api/api';
const LocationAutocomplete = forwardRef(
(
{
locaName,
setAppId,
setLocoName,
setPage,
@@ -92,6 +93,13 @@ const LocationAutocomplete = forwardRef(
<Autocomplete
id="location-autocomplete"
options={locations || []}
// Controlled by the caller's `locaName` string (the selected zone's
// locationname) so an external reset (e.g. setLocoName('All')) is
// reflected in the input — previously uncontrolled, so callers
// passing `locaName` had no effect and the pill silently kept
// showing the last user-picked zone.
value={locaName ? (locations || []).find((l) => l.locationname === locaName) ?? null : null}
isOptionEqualToValue={(option, value) => option?.applocationid === value?.applocationid}
getOptionLabel={(option) => option?.locationname ?? ''}
PaperComponent={paperComponent}
sx={{ ...sx }}