feat: update color carrier
This commit is contained in:
@@ -174,9 +174,12 @@ export const StationListPage = observer(() => {
|
||||
|
||||
const rows = useMemo(() => {
|
||||
const { selectedCityId } = selectedCityStore;
|
||||
if (!selectedCityId) {
|
||||
return [];
|
||||
}
|
||||
const query = searchQuery.trim().toLowerCase();
|
||||
return stationLists[language].data
|
||||
.filter((station: any) => !selectedCityId || station.city_id === selectedCityId)
|
||||
.filter((station: any) => station.city_id === selectedCityId)
|
||||
.filter(
|
||||
(station: any) =>
|
||||
!query ||
|
||||
@@ -202,7 +205,11 @@ export const StationListPage = observer(() => {
|
||||
<div className="flex justify-between items-center mb-10">
|
||||
<h1 className="text-2xl">Остановки</h1>
|
||||
{canWriteStations && (
|
||||
<CreateButton label="Создать остановку" path="/station/create" />
|
||||
<CreateButton
|
||||
label="Создать остановку"
|
||||
path="/station/create"
|
||||
disabled={!selectedCityStore.selectedCityId}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -277,7 +284,13 @@ export const StationListPage = observer(() => {
|
||||
slots={{
|
||||
noRowsOverlay: () => (
|
||||
<Box sx={{ mt: 5, textAlign: "center", color: "text.secondary" }}>
|
||||
{isLoading ? <CircularProgress size={20} /> : "Нет остановок"}
|
||||
{isLoading ? (
|
||||
<CircularProgress size={20} />
|
||||
) : !selectedCityStore.selectedCityId ? (
|
||||
"Выберите город"
|
||||
) : (
|
||||
"Нет остановок"
|
||||
)}
|
||||
</Box>
|
||||
),
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user