|
|
@@ -262,6 +262,7 @@ export default function MyPlacesPage() {
|
|
|
const [loading, setLoading] = useState(true)
|
|
|
const [editId, setEditId] = useState<string | null>(null)
|
|
|
const [filter, setFilter] = useState('all')
|
|
|
+ const [toast, setToast] = useState('')
|
|
|
|
|
|
const fetchPlaces = () => {
|
|
|
setLoading(true)
|
|
|
@@ -278,6 +279,8 @@ export default function MyPlacesPage() {
|
|
|
<div className="mx-auto max-w-3xl px-4">
|
|
|
<h1 className="mb-6 text-2xl font-bold text-white">Мои места</h1>
|
|
|
|
|
|
+ {toast && <p className="mb-4 rounded-lg bg-green-500/15 px-4 py-3 text-sm text-green-400 text-center font-medium">{toast}</p>}
|
|
|
+
|
|
|
<div className="mb-6 flex flex-wrap gap-2">
|
|
|
{FILTERS.map((f) => {
|
|
|
const count = f.key === 'all' ? places.length : places.filter((p) => p.status === f.key).length
|
|
|
@@ -338,7 +341,7 @@ export default function MyPlacesPage() {
|
|
|
</div>
|
|
|
|
|
|
{editId && (
|
|
|
- <PlaceEditModal placeId={editId} onClose={() => setEditId(null)} onSaved={() => { setEditId(null); fetchPlaces() }} />
|
|
|
+ <PlaceEditModal placeId={editId} onClose={() => setEditId(null)} onSaved={() => { setEditId(null); setToast('Сохранено'); setTimeout(() => setToast(''), 3000); fetchPlaces() }} />
|
|
|
)}
|
|
|
</div>
|
|
|
)
|