Rezygnacja z bazy, przeniesienie danych do plików yamla
This commit is contained in:
@@ -58,23 +58,28 @@ export default function JamboxChannelsSearch() {
|
||||
|
||||
const meta = useMemo(() => {
|
||||
const qq = q.trim();
|
||||
if (qq.length === 0) return "";
|
||||
if (qq.length === 0) return "";
|
||||
// "Zacznij pisać, aby wyszukać"
|
||||
if (loading) return "Szukam…";
|
||||
if (err) return err;
|
||||
return `Znaleziono: ${items.length}`;
|
||||
}, [q, loading, err, items]);
|
||||
|
||||
function scrollToPackage(packageId) {
|
||||
const el = document.getElementById(`pkg-${packageId}`);
|
||||
if (!el) return;
|
||||
function scrollToPackage(packageName) {
|
||||
const key = String(packageName || "").trim();
|
||||
if (!key) return;
|
||||
|
||||
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
|
||||
el.classList.add("is-target");
|
||||
window.setTimeout(() => el.classList.remove("is-target"), 5400);
|
||||
const el = document.getElementById(`pkg-${key}`);
|
||||
if (!el) {
|
||||
console.warn("❌ Nie znaleziono pakietu w DOM:", `pkg-${key}`);
|
||||
return;
|
||||
}
|
||||
|
||||
el.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
el.classList.add("is-target");
|
||||
window.setTimeout(() => el.classList.remove("is-target"), 5400);
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="f-chsearch">
|
||||
<h1 class="f-section-title">Wyszukiwanie kanałów w pakietach telewizji</h1>
|
||||
@@ -137,20 +142,18 @@ export default function JamboxChannelsSearch() {
|
||||
|
||||
{Array.isArray(c.packages) && c.packages.length > 0 && (
|
||||
<div class="f-chsearch__packages">
|
||||
Dostępny w:
|
||||
Dostępny w pakietach:
|
||||
{c.packages.map((p, i) => (
|
||||
<span key={p.id}>
|
||||
<button
|
||||
type="button"
|
||||
class="f-chsearch__pkg"
|
||||
onClick={() => scrollToPackage(p.id)}
|
||||
class="f-chsearch-pkg"
|
||||
onClick={() => scrollToPackage(p.name)}
|
||||
>
|
||||
{p.name}
|
||||
</button>
|
||||
<span class="f-chsearch__pkgnum">
|
||||
{" "} (kanał {p.number})
|
||||
</span>
|
||||
{i < c.packages.length - 1 ? ", " : ""}
|
||||
|
||||
{/* {i < c.packages.length - 1 ? ", " : ""} */}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
@@ -159,7 +162,7 @@ export default function JamboxChannelsSearch() {
|
||||
</div>
|
||||
))}
|
||||
|
||||
{q.trim().length >= 2 && !loading && items.length === 0 && (
|
||||
{q.trim().length >= 1 && !loading && items.length === 0 && (
|
||||
<div class="f-chsearch-empty">
|
||||
Brak wyników dla: <strong>{q}</strong>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user