Obiekt zweryfikowany

Strzelnica do cel

Sofoklesa 32, Poznań 5.0 · 2 opinieOtwarte do 20:00
127 890 129 Dojazd
stanowisk
7
2 pakiety
od 2 zł
ocena · 2 opinie
5.0
zdjęć w galerii
5
Info

Poznaj strzelnicę

'use client'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; import { Save, Upload, Trash2, Video, Image as ImageIcon, MapPin, ChevronLeft, ChevronRight } from 'lucide-react'; const port = process.env.NEXT_PUBLIC_BACKEND_PORT || 'http://localhost:5010'; const theme = { primary: '#edd600', darkGrey: '#1a1a1a', text: '#e1e1e1', muted: '#a0a0a0', border: '#262626', danger: '#ef4444' }; const Card = styled.div` background: ${theme.darkGrey}; border: 1px solid ${theme.border}; border-radius: 16px; padding: 2rem; @media (max-width: 768px) { padding: 1.2rem; } `; const FormGrid = styled.div` display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; @media (max-width: 768px) { grid-template-columns: 1fr; gap: 1rem; } `; const FormGroup = styled.div` display: flex; flex-direction: column; gap: 0.5rem; `; const Label = styled.label` color: ${theme.muted}; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; `; const Input = styled.input` width: 100%; box-sizing: border-box; padding: 0.8rem 1rem; background-color: #000; border: 1px solid ${theme.border}; color: #fff; border-radius: 8px; outline: none; transition: 0.2s; &:focus:not(:read-only) { border-color: ${theme.primary}; } &:read-only { opacity: 0.5; cursor: not-allowed; background-color: #0a0a0a; border-color: #222; } `; const TextArea = styled.textarea` width: 100%; box-sizing: border-box; padding: 0.8rem 1rem; background-color: #000; border: 1px solid ${theme.border}; color: #fff; border-radius: 8px; min-height: 100px; outline: none; resize: vertical; transition: 0.2s; &:focus { border-color: ${theme.primary}; } `; const SubmitBtn = styled.button` background-color: ${theme.primary}; font-size: 14px; color: #000; border: none; padding: 5px 10px; font-weight: 700; text-transform: uppercase; cursor: pointer; border-radius: 8px; margin-top: 1.5rem; display: flex; align-items: center; gap: 10px; width: fit-content; &:hover:not(:disabled) { transform: scale(1.02); } &:disabled { background-color: #555; cursor: not-allowed; } @media (max-width: 768px) { width: 100%; justify-content: center; } `; const UploadBtn = styled.label` display: flex; align-items: center; justify-content: center; gap: 8px; background: #000; color: ${theme.text}; border: 1px dashed ${theme.muted}; padding: 0.8rem; border-radius: 8px; cursor: pointer; transition: 0.2s; &:hover { border-color: ${theme.primary}; color: ${theme.primary}; } input { display: none; } `; const GalleryGrid = styled.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 1rem; `; const MediaCard = styled.div` position: relative; border-radius: 10px; overflow: hidden; border: 1px solid ${theme.border}; background: #000; `; const MediaPreview = styled.div` position: relative; aspect-ratio: 16 / 9; background: #000; img, video { width: 100%; height: 100%; object-fit: cover; display: block; } `; const MediaTopActions = styled.div` position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; z-index: 10; `; const MediaBottomActions = styled.div` display: flex; justify-content: space-between; gap: 8px; padding: 8px; background: #0b0b0b; border-top: 1px solid ${theme.border}; `; const IconBtn = styled.button` background: rgba(0, 0, 0, 0.75); color: #fff; border: 1px solid ${theme.border}; border-radius: 6px; padding: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; &:hover:not(:disabled) { border-color: ${theme.primary}; color: ${theme.primary}; } &:disabled { opacity: 0.35; cursor: not-allowed; } `; const DangerBtn = styled(IconBtn)` background: rgba(239, 68, 68, 0.8); border-color: rgba(239, 68, 68, 0.8); &:hover:not(:disabled) { border-color: ${theme.danger}; color: #fff; } `; const MediaIndexBadge = styled.div` color: ${theme.muted}; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; `; export default function TabInfo({ formData, setFormData, saveInfoToDB, saving }: any) { const [uploading, setUploading] = useState(false); const [triggerSave, setTriggerSave] = useState(false); useEffect(() => { if (triggerSave) { saveInfoToDB(); setTriggerSave(false); } }, [triggerSave, saveInfoToDB]); const uploadSingleFile = async (file: File) => { const data = new FormData(); data.append('image', file); const res = await fetch(`https://api.guntime.pl/api/upload`, { method: 'POST', body: data }); if (!res.ok) { throw new Error('Nie udało się przesłać pliku.'); } const filePath = await res.text(); return `https://api.guntime.pl${filePath}`; }; const handleFileUpload = async ( e: React.ChangeEvent<HTMLInputElement>, field: 'wallpaper' | 'gallery' ) => { const files = Array.from(e.target.files || []); if (files.length === 0) return; setUploading(true); try { if (field === 'wallpaper') { const uploadedPath = await uploadSingleFile(files[0]); setFormData((prev: any) => ({ ...prev, wallpaper: uploadedPath })); setTriggerSave(true); } else { const uploadedPaths: string[] = []; for (const file of files) { const uploadedPath = await uploadSingleFile(file); uploadedPaths.push(uploadedPath); } setFormData((prev: any) => ({ ...prev, images: [...(prev.images || []), ...uploadedPaths] })); setTriggerSave(true); } } catch (err) { console.error('Błąd przesyłania:', err); alert('Nie udało się przesłać jednego lub kilku plików.'); } finally { setUploading(false); e.target.value = ''; } }; const removeGalleryImage = (indexToRemove: number) => { setFormData((prev: any) => ({ ...prev, images: (prev.images || []).filter((_: string, i: number) => i !== indexToRemove) })); setTriggerSave(true); }; const moveGalleryImage = (fromIndex: number, toIndex: number) => { setFormData((prev: any) => { const images = [...(prev.images || [])]; if ( fromIndex < 0 || toIndex < 0 || fromIndex >= images.length || toIndex >= images.length ) { return prev; } const [movedItem] = images.splice(fromIndex, 1); images.splice(toIndex, 0, movedItem); return { ...prev, images }; }); setTriggerSave(true); }; const isVideo = (url: string) => /\.(mp4|webm|ogg|mov)$/i.test(url); const updateAddress = (field: string, value: any) => { setFormData((prev: any) => ({ ...prev, [field]: value, address: { ...(prev.address || {}), [field]: value } })); }; const updateContact = (field: string, value: any) => { setFormData((prev: any) => ({ ...prev, [field]: value, contact: { ...(prev.contact || {}), [field]: value } })); }; const updateCoords = (index: number, val: string) => { setFormData((prev: any) => { const currentCoords = prev.address?.location?.coordinates || [0, 0]; const newCoords = [...currentCoords]; newCoords[index] = val ? parseFloat(val) : 0; return { ...prev, address: { ...(prev.address || {}), location: { type: 'Point', coordinates: newCoords } } }; }); }; const handleAddressBlur = async () => { saveInfoToDB(); if (locationMode === 'address') { const street = formData.address?.street || formData.street; const city = formData.address?.city || formData.city; if (street && city) { try { const res = await fetch( `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent( street + ', ' + city )}&limit=1` ); const data = await res.json(); if (data && data.length > 0) { const newLat = parseFloat(data[0].lat); const newLng = parseFloat(data[0].lon); setFormData((prev: any) => ({ ...prev, address: { ...prev.address, location: { type: 'Point', coordinates: [newLng, newLat] } } })); setTriggerSave(true); } } catch (err) { console.error(err); } } } }; const handleCoordsBlur = async () => { saveInfoToDB(); if (locationMode === 'coordinates') { const coords = formData.address?.location?.coordinates || []; const clng = coords[0]; const clat = coords[1]; if (clat && clng) { try { const res = await fetch( `https://nominatim.openstreetmap.org/reverse?format=json&lat=${clat}&lon=${clng}&addressdetails=1&accept-language=pl` ); const data = await res.json(); if (data && data.address) { const newCity = data.address.city || data.address.town || data.address.village || formData.address?.city; const newStreet = `${data.address.road || ''} ${data.address.house_number || ''}`.trim() || formData.address?.street; setFormData((prev: any) => ({ ...prev, address: { ...prev.address, city: newCity || '', street: newStreet || '' } })); setTriggerSave(true); } } catch (err) { console.error(err); } } } }; const locationMode = formData.address?.locationMode || 'address'; const coords = formData.address?.location?.coordinates || []; const lng = coords.length > 0 ? coords[0] : ''; const lat = coords.length > 1 ? coords[1] : ''; return ( <Card> <h3 style={{ marginTop: 0, color: theme.primary, marginBottom: '2rem' }}> Edytuj informacje o obiekcie </h3> <FormGrid> <FormGroup> <Label>Nazwa strzelnicy</Label> <Input value={formData.name || ''} onChange={e => setFormData({ ...formData, name: e.target.value })} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup> <Label>Telefon kontaktowy</Label> <Input value={formData.contact?.phone || formData.phone || ''} onChange={e => updateContact('phone', e.target.value)} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>E-mail kontaktowy</Label> <Input value={formData.contact?.email || formData.email || ''} onChange={e => updateContact('email', e.target.value)} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1', marginTop: '0.5rem', padding: '1.5rem', background: '#111', borderRadius: '12px', border: `1px dashed ${theme.border}` }} > <Label style={{ display: 'flex', alignItems: 'center', gap: '8px', color: theme.primary, fontSize: '0.95rem' }} > <MapPin size={18} /> Lokalizacja obiektu </Label> <div style={{ display: 'flex', gap: '2rem', marginTop: '15px', marginBottom: '1.5rem', flexWrap: 'wrap', paddingBottom: '1rem', borderBottom: `1px solid ${theme.border}` }} > <label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', color: locationMode === 'address' ? '#fff' : theme.muted }} > <input type="radio" checked={locationMode === 'address'} onChange={() => { updateAddress('locationMode', 'address'); setTimeout(saveInfoToDB, 100); }} style={{ accentColor: theme.primary, width: '18px', height: '18px' }} /> Wyznaczaj automatycznie z adresu </label> <label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', color: locationMode === 'coordinates' ? '#fff' : theme.muted }} > <input type="radio" checked={locationMode === 'coordinates'} onChange={() => { updateAddress('locationMode', 'coordinates'); setTimeout(saveInfoToDB, 100); }} style={{ accentColor: theme.primary, width: '18px', height: '18px' }} /> Wpisz koordynaty ręcznie </label> </div> <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: '1.5rem', marginBottom: '1.5rem' }} > <FormGroup> <Label>Ulica i numer</Label> <Input value={formData.address?.street || formData.street || ''} onChange={e => updateAddress('street', e.target.value)} onBlur={handleAddressBlur} readOnly={locationMode === 'coordinates'} title={ locationMode === 'coordinates' ? 'Tryb GPS aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> <FormGroup> <Label>Miasto</Label> <Input value={formData.address?.city || formData.city || ''} onChange={e => updateAddress('city', e.target.value)} onBlur={handleAddressBlur} readOnly={locationMode === 'coordinates'} title={ locationMode === 'coordinates' ? 'Tryb GPS aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> </div> <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: '1.5rem' }} > <FormGroup> <Label>Szerokość (Lat) np. 52.2297</Label> <Input type="number" step="any" value={lat} readOnly={locationMode === 'address'} onChange={e => updateCoords(1, e.target.value)} onBlur={handleCoordsBlur} title={ locationMode === 'address' ? 'Tryb adresu aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> <FormGroup> <Label>Długość (Lng) np. 21.0122</Label> <Input type="number" step="any" value={lng} readOnly={locationMode === 'address'} onChange={e => updateCoords(0, e.target.value)} onBlur={handleCoordsBlur} title={ locationMode === 'address' ? 'Tryb adresu aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> </div> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>Opis obiektu</Label> <TextArea value={formData.description || ''} onChange={e => setFormData({ ...formData, description: e.target.value })} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>Główne zdjęcie w tle (Wallpaper)</Label> <div style={{ display: 'flex', gap: '10px', alignItems: 'center', flexWrap: 'wrap' }}> <Input style={{ flex: 1, minWidth: '200px' }} placeholder="URL obrazu lub wgraj plik obok ->" value={formData.wallpaper || ''} onChange={e => setFormData({ ...formData, wallpaper: e.target.value })} onBlur={saveInfoToDB} /> <UploadBtn> <Upload size={18} /> {uploading ? 'Wgrywam...' : 'Z komputera'} <input type="file" accept="image/*" onChange={e => handleFileUpload(e, 'wallpaper')} disabled={uploading} /> </UploadBtn> </div> {formData.wallpaper && ( <img src={formData.wallpaper} alt="Tło" style={{ width: '200px', height: '100px', objectFit: 'cover', borderRadius: '8px', marginTop: '10px', border: `1px solid ${theme.border}` }} /> )} </FormGroup> </FormGrid> <div style={{ marginTop: '3rem', borderTop: `1px dashed ${theme.border}`, paddingTop: '2rem' }}> <h3 style={{ color: theme.primary, display: 'flex', alignItems: 'center', gap: '8px', margin: '0 0 1.5rem 0' }} > <ImageIcon size={20} /> Galeria Multimediów </h3> <FormGroup style={{ marginBottom: '1.5rem' }}> <Label>Film promocyjny (Link do YouTube / Vimeo - Opcjonalnie)</Label> <div style={{ display: 'flex', gap: '10px', alignItems: 'center' }}> <Video size={20} color={theme.muted} /> <Input placeholder="https://youtube.com/..." value={formData.videoUrl || ''} onChange={e => setFormData({ ...formData, videoUrl: e.target.value })} onBlur={saveInfoToDB} /> </div> </FormGroup> <FormGroup> <Label>Zdjęcia i filmy z dysku do galerii</Label> <UploadBtn style={{ width: 'fit-content', padding: '0.8rem 2rem' }}> <Upload size={18} /> {uploading ? 'Wgrywam...' : 'Wgraj pliki (możesz wybrać wiele naraz)'} <input type="file" accept="image/*,video/mp4,video/webm,video/quicktime" multiple onChange={e => handleFileUpload(e, 'gallery')} disabled={uploading} /> </UploadBtn> <div style={{ color: theme.muted, fontSize: '0.85rem', marginTop: '8px' }}> Możesz zaznaczyć kilka zdjęć lub filmów jednocześnie. Kolejność w galerii zmienisz przyciskami pod miniaturą. </div> <GalleryGrid> {(formData.images || []).map((mediaUrl: string, idx: number) => ( <MediaCard key={`${mediaUrl}-${idx}`}> <MediaPreview> {isVideo(mediaUrl) ? ( <video src={mediaUrl} controls muted playsInline /> ) : ( <img src={mediaUrl} alt={`Galeria ${idx + 1}`} /> )} <MediaTopActions> <DangerBtn type="button" onClick={() => removeGalleryImage(idx)} title="Usuń"> <Trash2 size={14} /> </DangerBtn> </MediaTopActions> </MediaPreview> <MediaBottomActions> <div style={{ display: 'flex', gap: '6px' }}> <IconBtn type="button" onClick={() => moveGalleryImage(idx, idx - 1)} disabled={idx === 0} title="Przesuń w lewo" > <ChevronLeft size={16} /> </IconBtn> <IconBtn type="button" onClick={() => moveGalleryImage(idx, idx + 1)} disabled={idx === (formData.images || []).length - 1} title="Przesuń w prawo" > <ChevronRight size={16} /> </IconBtn> </div> <MediaIndexBadge>Pozycja: {idx + 1}</MediaIndexBadge> </MediaBottomActions> </MediaCard> ))} </GalleryGrid> </FormGroup> </div> <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginTop: '2.5rem', flexWrap: 'wrap' }} > <SubmitBtn onClick={saveInfoToDB} disabled={saving}> <Save size={18} /> Zapisz </SubmitBtn> <span style={{ color: theme.muted, fontSize: '0.85rem' }}> * Zmiany w formularzu zapisują się automatycznie po odkliknięciu pola. Zdjęcia zapisują się same. </span> </div> </Card> ); }
Galeria

Obiekt w kadrze

Stanowiska

Plan torów

Tor 1
Tor 2
Tor 3
Tor 4
Tor 5
Tor 6
Tor 7
Opinie
5.0
2 opinii
Jasiuuu05.11.2026

Superowo

Archiwalna opinia02.06.2026

Fajnie

Social media

Obserwuj strzelnicę

Najbliższe zawody

Zawody
Ta strzelnica nie ma obecnie zaplanowanych zawodów.

O strzelnicy

'use client'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; import { Save, Upload, Trash2, Video, Image as ImageIcon, MapPin, ChevronLeft, ChevronRight } from 'lucide-react'; const port = process.env.NEXT_PUBLIC_BACKEND_PORT || 'http://localhost:5010'; const theme = { primary: '#edd600', darkGrey: '#1a1a1a', text: '#e1e1e1', muted: '#a0a0a0', border: '#262626', danger: '#ef4444' }; const Card = styled.div` background: ${theme.darkGrey}; border: 1px solid ${theme.border}; border-radius: 16px; padding: 2rem; @media (max-width: 768px) { padding: 1.2rem; } `; const FormGrid = styled.div` display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; @media (max-width: 768px) { grid-template-columns: 1fr; gap: 1rem; } `; const FormGroup = styled.div` display: flex; flex-direction: column; gap: 0.5rem; `; const Label = styled.label` color: ${theme.muted}; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; `; const Input = styled.input` width: 100%; box-sizing: border-box; padding: 0.8rem 1rem; background-color: #000; border: 1px solid ${theme.border}; color: #fff; border-radius: 8px; outline: none; transition: 0.2s; &:focus:not(:read-only) { border-color: ${theme.primary}; } &:read-only { opacity: 0.5; cursor: not-allowed; background-color: #0a0a0a; border-color: #222; } `; const TextArea = styled.textarea` width: 100%; box-sizing: border-box; padding: 0.8rem 1rem; background-color: #000; border: 1px solid ${theme.border}; color: #fff; border-radius: 8px; min-height: 100px; outline: none; resize: vertical; transition: 0.2s; &:focus { border-color: ${theme.primary}; } `; const SubmitBtn = styled.button` background-color: ${theme.primary}; font-size: 14px; color: #000; border: none; padding: 5px 10px; font-weight: 700; text-transform: uppercase; cursor: pointer; border-radius: 8px; margin-top: 1.5rem; display: flex; align-items: center; gap: 10px; width: fit-content; &:hover:not(:disabled) { transform: scale(1.02); } &:disabled { background-color: #555; cursor: not-allowed; } @media (max-width: 768px) { width: 100%; justify-content: center; } `; const UploadBtn = styled.label` display: flex; align-items: center; justify-content: center; gap: 8px; background: #000; color: ${theme.text}; border: 1px dashed ${theme.muted}; padding: 0.8rem; border-radius: 8px; cursor: pointer; transition: 0.2s; &:hover { border-color: ${theme.primary}; color: ${theme.primary}; } input { display: none; } `; const GalleryGrid = styled.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 1rem; `; const MediaCard = styled.div` position: relative; border-radius: 10px; overflow: hidden; border: 1px solid ${theme.border}; background: #000; `; const MediaPreview = styled.div` position: relative; aspect-ratio: 16 / 9; background: #000; img, video { width: 100%; height: 100%; object-fit: cover; display: block; } `; const MediaTopActions = styled.div` position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; z-index: 10; `; const MediaBottomActions = styled.div` display: flex; justify-content: space-between; gap: 8px; padding: 8px; background: #0b0b0b; border-top: 1px solid ${theme.border}; `; const IconBtn = styled.button` background: rgba(0, 0, 0, 0.75); color: #fff; border: 1px solid ${theme.border}; border-radius: 6px; padding: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; &:hover:not(:disabled) { border-color: ${theme.primary}; color: ${theme.primary}; } &:disabled { opacity: 0.35; cursor: not-allowed; } `; const DangerBtn = styled(IconBtn)` background: rgba(239, 68, 68, 0.8); border-color: rgba(239, 68, 68, 0.8); &:hover:not(:disabled) { border-color: ${theme.danger}; color: #fff; } `; const MediaIndexBadge = styled.div` color: ${theme.muted}; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; `; export default function TabInfo({ formData, setFormData, saveInfoToDB, saving }: any) { const [uploading, setUploading] = useState(false); const [triggerSave, setTriggerSave] = useState(false); useEffect(() => { if (triggerSave) { saveInfoToDB(); setTriggerSave(false); } }, [triggerSave, saveInfoToDB]); const uploadSingleFile = async (file: File) => { const data = new FormData(); data.append('image', file); const res = await fetch(`https://api.guntime.pl/api/upload`, { method: 'POST', body: data }); if (!res.ok) { throw new Error('Nie udało się przesłać pliku.'); } const filePath = await res.text(); return `https://api.guntime.pl${filePath}`; }; const handleFileUpload = async ( e: React.ChangeEvent<HTMLInputElement>, field: 'wallpaper' | 'gallery' ) => { const files = Array.from(e.target.files || []); if (files.length === 0) return; setUploading(true); try { if (field === 'wallpaper') { const uploadedPath = await uploadSingleFile(files[0]); setFormData((prev: any) => ({ ...prev, wallpaper: uploadedPath })); setTriggerSave(true); } else { const uploadedPaths: string[] = []; for (const file of files) { const uploadedPath = await uploadSingleFile(file); uploadedPaths.push(uploadedPath); } setFormData((prev: any) => ({ ...prev, images: [...(prev.images || []), ...uploadedPaths] })); setTriggerSave(true); } } catch (err) { console.error('Błąd przesyłania:', err); alert('Nie udało się przesłać jednego lub kilku plików.'); } finally { setUploading(false); e.target.value = ''; } }; const removeGalleryImage = (indexToRemove: number) => { setFormData((prev: any) => ({ ...prev, images: (prev.images || []).filter((_: string, i: number) => i !== indexToRemove) })); setTriggerSave(true); }; const moveGalleryImage = (fromIndex: number, toIndex: number) => { setFormData((prev: any) => { const images = [...(prev.images || [])]; if ( fromIndex < 0 || toIndex < 0 || fromIndex >= images.length || toIndex >= images.length ) { return prev; } const [movedItem] = images.splice(fromIndex, 1); images.splice(toIndex, 0, movedItem); return { ...prev, images }; }); setTriggerSave(true); }; const isVideo = (url: string) => /\.(mp4|webm|ogg|mov)$/i.test(url); const updateAddress = (field: string, value: any) => { setFormData((prev: any) => ({ ...prev, [field]: value, address: { ...(prev.address || {}), [field]: value } })); }; const updateContact = (field: string, value: any) => { setFormData((prev: any) => ({ ...prev, [field]: value, contact: { ...(prev.contact || {}), [field]: value } })); }; const updateCoords = (index: number, val: string) => { setFormData((prev: any) => { const currentCoords = prev.address?.location?.coordinates || [0, 0]; const newCoords = [...currentCoords]; newCoords[index] = val ? parseFloat(val) : 0; return { ...prev, address: { ...(prev.address || {}), location: { type: 'Point', coordinates: newCoords } } }; }); }; const handleAddressBlur = async () => { saveInfoToDB(); if (locationMode === 'address') { const street = formData.address?.street || formData.street; const city = formData.address?.city || formData.city; if (street && city) { try { const res = await fetch( `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent( street + ', ' + city )}&limit=1` ); const data = await res.json(); if (data && data.length > 0) { const newLat = parseFloat(data[0].lat); const newLng = parseFloat(data[0].lon); setFormData((prev: any) => ({ ...prev, address: { ...prev.address, location: { type: 'Point', coordinates: [newLng, newLat] } } })); setTriggerSave(true); } } catch (err) { console.error(err); } } } }; const handleCoordsBlur = async () => { saveInfoToDB(); if (locationMode === 'coordinates') { const coords = formData.address?.location?.coordinates || []; const clng = coords[0]; const clat = coords[1]; if (clat && clng) { try { const res = await fetch( `https://nominatim.openstreetmap.org/reverse?format=json&lat=${clat}&lon=${clng}&addressdetails=1&accept-language=pl` ); const data = await res.json(); if (data && data.address) { const newCity = data.address.city || data.address.town || data.address.village || formData.address?.city; const newStreet = `${data.address.road || ''} ${data.address.house_number || ''}`.trim() || formData.address?.street; setFormData((prev: any) => ({ ...prev, address: { ...prev.address, city: newCity || '', street: newStreet || '' } })); setTriggerSave(true); } } catch (err) { console.error(err); } } } }; const locationMode = formData.address?.locationMode || 'address'; const coords = formData.address?.location?.coordinates || []; const lng = coords.length > 0 ? coords[0] : ''; const lat = coords.length > 1 ? coords[1] : ''; return ( <Card> <h3 style={{ marginTop: 0, color: theme.primary, marginBottom: '2rem' }}> Edytuj informacje o obiekcie </h3> <FormGrid> <FormGroup> <Label>Nazwa strzelnicy</Label> <Input value={formData.name || ''} onChange={e => setFormData({ ...formData, name: e.target.value })} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup> <Label>Telefon kontaktowy</Label> <Input value={formData.contact?.phone || formData.phone || ''} onChange={e => updateContact('phone', e.target.value)} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>E-mail kontaktowy</Label> <Input value={formData.contact?.email || formData.email || ''} onChange={e => updateContact('email', e.target.value)} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1', marginTop: '0.5rem', padding: '1.5rem', background: '#111', borderRadius: '12px', border: `1px dashed ${theme.border}` }} > <Label style={{ display: 'flex', alignItems: 'center', gap: '8px', color: theme.primary, fontSize: '0.95rem' }} > <MapPin size={18} /> Lokalizacja obiektu </Label> <div style={{ display: 'flex', gap: '2rem', marginTop: '15px', marginBottom: '1.5rem', flexWrap: 'wrap', paddingBottom: '1rem', borderBottom: `1px solid ${theme.border}` }} > <label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', color: locationMode === 'address' ? '#fff' : theme.muted }} > <input type="radio" checked={locationMode === 'address'} onChange={() => { updateAddress('locationMode', 'address'); setTimeout(saveInfoToDB, 100); }} style={{ accentColor: theme.primary, width: '18px', height: '18px' }} /> Wyznaczaj automatycznie z adresu </label> <label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer', color: locationMode === 'coordinates' ? '#fff' : theme.muted }} > <input type="radio" checked={locationMode === 'coordinates'} onChange={() => { updateAddress('locationMode', 'coordinates'); setTimeout(saveInfoToDB, 100); }} style={{ accentColor: theme.primary, width: '18px', height: '18px' }} /> Wpisz koordynaty ręcznie </label> </div> <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: '1.5rem', marginBottom: '1.5rem' }} > <FormGroup> <Label>Ulica i numer</Label> <Input value={formData.address?.street || formData.street || ''} onChange={e => updateAddress('street', e.target.value)} onBlur={handleAddressBlur} readOnly={locationMode === 'coordinates'} title={ locationMode === 'coordinates' ? 'Tryb GPS aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> <FormGroup> <Label>Miasto</Label> <Input value={formData.address?.city || formData.city || ''} onChange={e => updateAddress('city', e.target.value)} onBlur={handleAddressBlur} readOnly={locationMode === 'coordinates'} title={ locationMode === 'coordinates' ? 'Tryb GPS aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> </div> <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: '1.5rem' }} > <FormGroup> <Label>Szerokość (Lat) np. 52.2297</Label> <Input type="number" step="any" value={lat} readOnly={locationMode === 'address'} onChange={e => updateCoords(1, e.target.value)} onBlur={handleCoordsBlur} title={ locationMode === 'address' ? 'Tryb adresu aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> <FormGroup> <Label>Długość (Lng) np. 21.0122</Label> <Input type="number" step="any" value={lng} readOnly={locationMode === 'address'} onChange={e => updateCoords(0, e.target.value)} onBlur={handleCoordsBlur} title={ locationMode === 'address' ? 'Tryb adresu aktywny. Pola wypełnią się automatycznie.' : '' } /> </FormGroup> </div> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>Opis obiektu</Label> <TextArea value={formData.description || ''} onChange={e => setFormData({ ...formData, description: e.target.value })} onBlur={saveInfoToDB} /> </FormGroup> <FormGroup style={{ gridColumn: '1 / -1' }}> <Label>Główne zdjęcie w tle (Wallpaper)</Label> <div style={{ display: 'flex', gap: '10px', alignItems: 'center', flexWrap: 'wrap' }}> <Input style={{ flex: 1, minWidth: '200px' }} placeholder="URL obrazu lub wgraj plik obok ->" value={formData.wallpaper || ''} onChange={e => setFormData({ ...formData, wallpaper: e.target.value })} onBlur={saveInfoToDB} /> <UploadBtn> <Upload size={18} /> {uploading ? 'Wgrywam...' : 'Z komputera'} <input type="file" accept="image/*" onChange={e => handleFileUpload(e, 'wallpaper')} disabled={uploading} /> </UploadBtn> </div> {formData.wallpaper && ( <img src={formData.wallpaper} alt="Tło" style={{ width: '200px', height: '100px', objectFit: 'cover', borderRadius: '8px', marginTop: '10px', border: `1px solid ${theme.border}` }} /> )} </FormGroup> </FormGrid> <div style={{ marginTop: '3rem', borderTop: `1px dashed ${theme.border}`, paddingTop: '2rem' }}> <h3 style={{ color: theme.primary, display: 'flex', alignItems: 'center', gap: '8px', margin: '0 0 1.5rem 0' }} > <ImageIcon size={20} /> Galeria Multimediów </h3> <FormGroup style={{ marginBottom: '1.5rem' }}> <Label>Film promocyjny (Link do YouTube / Vimeo - Opcjonalnie)</Label> <div style={{ display: 'flex', gap: '10px', alignItems: 'center' }}> <Video size={20} color={theme.muted} /> <Input placeholder="https://youtube.com/..." value={formData.videoUrl || ''} onChange={e => setFormData({ ...formData, videoUrl: e.target.value })} onBlur={saveInfoToDB} /> </div> </FormGroup> <FormGroup> <Label>Zdjęcia i filmy z dysku do galerii</Label> <UploadBtn style={{ width: 'fit-content', padding: '0.8rem 2rem' }}> <Upload size={18} /> {uploading ? 'Wgrywam...' : 'Wgraj pliki (możesz wybrać wiele naraz)'} <input type="file" accept="image/*,video/mp4,video/webm,video/quicktime" multiple onChange={e => handleFileUpload(e, 'gallery')} disabled={uploading} /> </UploadBtn> <div style={{ color: theme.muted, fontSize: '0.85rem', marginTop: '8px' }}> Możesz zaznaczyć kilka zdjęć lub filmów jednocześnie. Kolejność w galerii zmienisz przyciskami pod miniaturą. </div> <GalleryGrid> {(formData.images || []).map((mediaUrl: string, idx: number) => ( <MediaCard key={`${mediaUrl}-${idx}`}> <MediaPreview> {isVideo(mediaUrl) ? ( <video src={mediaUrl} controls muted playsInline /> ) : ( <img src={mediaUrl} alt={`Galeria ${idx + 1}`} /> )} <MediaTopActions> <DangerBtn type="button" onClick={() => removeGalleryImage(idx)} title="Usuń"> <Trash2 size={14} /> </DangerBtn> </MediaTopActions> </MediaPreview> <MediaBottomActions> <div style={{ display: 'flex', gap: '6px' }}> <IconBtn type="button" onClick={() => moveGalleryImage(idx, idx - 1)} disabled={idx === 0} title="Przesuń w lewo" > <ChevronLeft size={16} /> </IconBtn> <IconBtn type="button" onClick={() => moveGalleryImage(idx, idx + 1)} disabled={idx === (formData.images || []).length - 1} title="Przesuń w prawo" > <ChevronRight size={16} /> </IconBtn> </div> <MediaIndexBadge>Pozycja: {idx + 1}</MediaIndexBadge> </MediaBottomActions> </MediaCard> ))} </GalleryGrid> </FormGroup> </div> <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginTop: '2.5rem', flexWrap: 'wrap' }} > <SubmitBtn onClick={saveInfoToDB} disabled={saving}> <Save size={18} /> Zapisz </SubmitBtn> <span style={{ color: theme.muted, fontSize: '0.85rem' }}> * Zmiany w formularzu zapisują się automatycznie po odkliknięciu pola. Zdjęcia zapisują się same. </span> </div> </Card> ); }

Ze społeczności

Najnowsze wpisy strzelnicy i strzelców.

Tablica strzelnicy (4) →
Rewelacja Zweryfikowana wizyta
Superowo
Tor 3 Glock 18 Z instruktorem

Plan torów

7 stanowisk — opisy, długości i kalibry znajdziesz w zakładce „Stanowiska”.

Opisy stanowisk →
Tor 1
Tor 2
Tor 3
Tor 4
Tor 5
Tor 6
Tor 7

Pakiety

Gotowe zestawy — wybierz pakiet, a resztę ustawisz w rezerwacji.

Pakiet strzelca

abcd

strzelaniepistoletkarabin
200 zł

Pakiet strzelca 2

BCDA

pistoletkarabin
2 zł

Opinie

Oceny wystawione przez osoby, które strzelały na tym obiekcie.

5.0
2 opinie
52
40
30
20
10
Jasiuuu05.11.2026

Superowo

Archiwalna opinia02.06.2026

Fajnie

Galeria

5 zdjęć i filmów z obiektu.