brickwise 0.1.0 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brickwise",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "App local para analizar la rentabilidad de alquiler de inmuebles de Property Finder UAE con el histórico real de transacciones DLD.",
5
5
  "license": "MIT",
6
6
  "author": "eljommys",
@@ -0,0 +1,93 @@
1
+ Copyright 2025 The Stack Sans Project Authors (https://github.com/DylanYoungKoto/Stack-Sans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,68 @@
1
+ Stack Sans Notch Variable Font
2
+ ==============================
3
+
4
+ This download contains Stack Sans Notch as both a variable font and static fonts.
5
+
6
+ Stack Sans Notch is a variable font with this axis:
7
+ wght
8
+
9
+ This means all the styles are contained in a single file:
10
+ Stack_Sans_Notch/StackSansNotch-VariableFont_wght.ttf
11
+
12
+ If your app fully supports variable fonts, you can now pick intermediate styles
13
+ that aren’t available as static fonts. Not all apps support variable fonts, and
14
+ in those cases you can use the static font files for Stack Sans Notch:
15
+ Stack_Sans_Notch/static/StackSansNotch-ExtraLight.ttf
16
+ Stack_Sans_Notch/static/StackSansNotch-Light.ttf
17
+ Stack_Sans_Notch/static/StackSansNotch-Regular.ttf
18
+ Stack_Sans_Notch/static/StackSansNotch-Medium.ttf
19
+ Stack_Sans_Notch/static/StackSansNotch-SemiBold.ttf
20
+ Stack_Sans_Notch/static/StackSansNotch-Bold.ttf
21
+
22
+ Get started
23
+ -----------
24
+
25
+ 1. Install the font files you want to use
26
+
27
+ 2. Use your app's font picker to view the font family and all the
28
+ available styles
29
+
30
+ Learn more about variable fonts
31
+ -------------------------------
32
+
33
+ https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
34
+ https://variablefonts.typenetwork.com
35
+ https://medium.com/variable-fonts
36
+
37
+ In desktop apps
38
+
39
+ https://theblog.adobe.com/can-variable-fonts-illustrator-cc
40
+ https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
41
+
42
+ Online
43
+
44
+ https://developers.google.com/fonts/docs/getting_started
45
+ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
46
+ https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
47
+
48
+ Installing fonts
49
+
50
+ MacOS: https://support.apple.com/en-us/HT201749
51
+ Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
52
+ Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
53
+
54
+ Android Apps
55
+
56
+ https://developers.google.com/fonts/docs/android
57
+ https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
58
+
59
+ License
60
+ -------
61
+ Please read the full license text (OFL.txt) to understand the permissions,
62
+ restrictions and requirements for usage, redistribution, and modification.
63
+
64
+ You can use them in your products & projects – print or digital,
65
+ commercial or otherwise.
66
+
67
+ This isn't legal advice, please consider consulting a lawyer and see the full
68
+ license for all details.
@@ -34,6 +34,10 @@ interface FavRow {
34
34
 
35
35
  const GYM_SVG = `<svg viewBox="0 0 24 24" width="14" height="14" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M2 10h2v4H2zM5 8h2v8H5zM17 8h2v8h-2zM20 10h2v4h-2zM8 11h8v2H8z"/></svg>`;
36
36
 
37
+ function matchesBedFilter(r: { bedrooms: number | null }, bedFilter: number[]): boolean {
38
+ return bedFilter.length === 0 || (r.bedrooms != null && bedFilter.includes(r.bedrooms));
39
+ }
40
+
37
41
  function yieldColor(y: number | null): string {
38
42
  if (y == null) return "#737373";
39
43
  if (y >= 0.07) return "#059669";
@@ -88,6 +92,8 @@ export default function FavoritesMapPage() {
88
92
  const [gymsVisible, setGymsVisible] = useState(false);
89
93
  const [gymsLoading, setGymsLoading] = useState(false);
90
94
  const [gymCount, setGymCount] = useState<number | null>(null);
95
+ const [sortBy, setSortBy] = useState<"yield" | "price">("yield");
96
+ const [bedFilter, setBedFilter] = useState<number[]>([]);
91
97
 
92
98
  const mapRef = useRef<LeafletMap | null>(null);
93
99
  const leafletRef = useRef<typeof import("leaflet") | null>(null);
@@ -223,6 +229,16 @@ export default function FavoritesMapPage() {
223
229
  }
224
230
  }, [hoveredId]);
225
231
 
232
+ // --- Filter: dim (darker + transparent) the markers that don't match -----
233
+ useEffect(() => {
234
+ const byId = new Map((rows ?? []).map((r) => [r.id, r]));
235
+ for (const [id, m] of Object.entries(markersRef.current)) {
236
+ const r = byId.get(id);
237
+ const dim = !!r && !matchesBedFilter(r, bedFilter);
238
+ m.getElement()?.querySelector(".bw-pin")?.classList.toggle("bw-pin--dim", dim);
239
+ }
240
+ }, [bedFilter, rows, mapReady]);
241
+
226
242
  // --- Add-by-URL queue ----------------------------------------------------
227
243
  useEffect(() => {
228
244
  if (processing.current || queue.length === 0) return;
@@ -327,7 +343,7 @@ export default function FavoritesMapPage() {
327
343
  const mapsUrl = `https://www.google.com/maps/search/?api=1&query=${g.lat}%2C${g.lon}`;
328
344
  L.marker([g.lat, g.lon], { icon })
329
345
  .bindPopup(
330
- `<b>🏋️ ${safeName}</b><br><a href="${mapsUrl}" target="_blank" rel="noopener noreferrer" style="font-size:12px">Ver en Google Maps ↗</a>`,
346
+ `<b>${safeName}</b><br><a href="${mapsUrl}" target="_blank" rel="noopener noreferrer" style="font-size:12px">Ver en Google Maps ↗</a>`,
331
347
  { offset: [0, -16] }
332
348
  )
333
349
  .addTo(layer);
@@ -368,6 +384,104 @@ export default function FavoritesMapPage() {
368
384
 
369
385
  const busy = queue.length > 0;
370
386
 
387
+ const sorted = [...(rows ?? [])].sort((a, b) =>
388
+ sortBy === "price"
389
+ ? a.price - b.price
390
+ : (b.gross_yield ?? -1) - (a.gross_yield ?? -1)
391
+ );
392
+ const visible = sorted.filter((r) => matchesBedFilter(r, bedFilter));
393
+ const dimmed = sorted.filter((r) => !matchesBedFilter(r, bedFilter));
394
+ const bedOptions = Array.from(
395
+ new Set((rows ?? []).map((r) => r.bedrooms).filter((b): b is number => b != null))
396
+ ).sort((a, b) => a - b);
397
+ const bedLabel = (b: number) => (b === 0 ? "Studio" : String(b));
398
+ const toggleBed = (b: number) =>
399
+ setBedFilter((prev) => (prev.includes(b) ? prev.filter((x) => x !== b) : [...prev, b]));
400
+
401
+ const renderCard = (r: FavRow, dim = false) => (
402
+ <div
403
+ key={r.id}
404
+ id={`fav-${r.id}`}
405
+ onMouseEnter={() => setHoveredId(r.id)}
406
+ onMouseLeave={() => setHoveredId(null)}
407
+ className={`border-b border-neutral-100 p-3 transition-colors dark:border-neutral-800 ${
408
+ hoveredId === r.id ? "bg-blue-50 dark:bg-neutral-800" : ""
409
+ } ${dim ? "opacity-40 grayscale" : ""}`}
410
+ >
411
+ <div className="flex gap-3">
412
+ {r.images?.[0] && (
413
+ // eslint-disable-next-line @next/next/no-img-element
414
+ <img
415
+ src={r.images[0].small}
416
+ alt=""
417
+ onClick={() => focus(r)}
418
+ className="h-16 w-24 shrink-0 cursor-pointer rounded-lg object-cover"
419
+ loading="lazy"
420
+ />
421
+ )}
422
+ <div className="min-w-0 flex-1">
423
+ <div className="flex items-start justify-between gap-2">
424
+ <button
425
+ onClick={() => focus(r)}
426
+ className="line-clamp-1 text-left font-sans text-sm font-semibold normal-case tracking-normal hover:underline"
427
+ title="Centrar en el mapa"
428
+ >
429
+ {r.title}
430
+ </button>
431
+ <button
432
+ onClick={() => remove(r.id)}
433
+ title="Quitar de favoritos"
434
+ className="shrink-0 rounded-md px-1.5 text-xs text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-950"
435
+ >
436
+
437
+ </button>
438
+ </div>
439
+ <div className="truncate text-xs text-neutral-500">
440
+ {r.tower_name} · {r.bedrooms === 0 ? "Studio" : `${r.bedrooms ?? "?"} hab`} / {r.bathrooms ?? "?"} baños ·{" "}
441
+ {fmtSqft(r.size_sqft)}
442
+ </div>
443
+ <div className="mt-1 flex items-center gap-2">
444
+ <YieldBadge value={r.gross_yield} n={r.rent_n ?? undefined} />
445
+ {r.asking_yield != null && (
446
+ <span className="text-xs text-neutral-500">s/ anuncio: {(r.asking_yield * 100).toFixed(1)} %</span>
447
+ )}
448
+ </div>
449
+ </div>
450
+ </div>
451
+
452
+ <div className="mt-2 grid grid-cols-2 gap-x-4 gap-y-0.5 text-xs text-neutral-600 dark:text-neutral-400">
453
+ <span>
454
+ Precio: <b className="text-neutral-900 dark:text-neutral-100">{fmtAED(r.price)}</b>
455
+ </span>
456
+ <span>AED/sqft: {r.price_per_sqft ? Math.round(r.price_per_sqft) : "—"}</span>
457
+ <span>
458
+ Renta mediana: {fmtAED(r.median_rent)}
459
+ {r.rent_n ? ` (${r.rent_n})` : ""}
460
+ </span>
461
+ <span>
462
+ Venta mediana: {fmtAED(r.median_sale_price)}
463
+ {r.buy_n ? ` (${r.buy_n})` : ""}
464
+ </span>
465
+ <span title={r.gym_name ?? undefined}>Gym: {fmtDist(r.gym_distance_m)}</span>
466
+ <span className="flex gap-2">
467
+ <Link href={`/listing/${r.id}`} className="font-medium text-blue-600 hover:underline dark:text-blue-400">
468
+ Ver análisis
469
+ </Link>
470
+ <a href={r.url} target="_blank" rel="noopener noreferrer" className="font-medium text-blue-600 hover:underline dark:text-blue-400">
471
+ PF ↗
472
+ </a>
473
+ </span>
474
+ </div>
475
+
476
+ <textarea
477
+ className="mt-2 h-9 w-full resize-none rounded-md border border-transparent bg-neutral-50 px-2 py-1 text-xs outline-none focus:border-neutral-300 dark:bg-neutral-950 dark:focus:border-neutral-700"
478
+ defaultValue={r.notes}
479
+ placeholder="notas…"
480
+ onBlur={(e) => saveNotes(r.id, e.target.value)}
481
+ />
482
+ </div>
483
+ );
484
+
371
485
  return (
372
486
  <div className="fixed inset-0 flex overflow-hidden">
373
487
  {/* ------------------------------------------------ sidebar */}
@@ -377,15 +491,12 @@ export default function FavoritesMapPage() {
377
491
  className="flex min-h-0 shrink-0 flex-col border-r border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"
378
492
  >
379
493
  <div className="flex items-center gap-3 border-b border-neutral-200 px-3 py-2 dark:border-neutral-800">
380
- <Link href="/" className="text-sm font-bold tracking-tight">
381
- 🧱 Brickwise
494
+ <Link href="/" className="font-brand text-sm font-bold tracking-tight">
495
+ Brickwise
382
496
  </Link>
383
497
  <span className="ml-auto flex items-center gap-1 text-xs">
384
- <Link href="/search" className="rounded-full px-2.5 py-1 font-medium text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800">
385
- 🔍 Buscar
386
- </Link>
387
- <Link href="/" className="rounded-full px-2.5 py-1 font-medium text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800">
388
- 📊 Analizados
498
+ <Link href="/" className="btn-font rounded-full px-2.5 py-1 font-medium text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800">
499
+ Analizados
389
500
  </Link>
390
501
  </span>
391
502
  </div>
@@ -403,7 +514,7 @@ export default function FavoritesMapPage() {
403
514
  disabled={!input.trim() || busy}
404
515
  className="rounded-lg bg-blue-600 px-4 py-1.5 text-xs font-bold text-white hover:bg-blue-500 disabled:opacity-50"
405
516
  >
406
- {busy ? `Analizando ${queue.length}…` : "Añadir y analizar"}
517
+ {busy ? `Analizando ${queue.length}…` : "Añadir y analizar"}
407
518
  </button>
408
519
  <button
409
520
  type="button"
@@ -415,9 +526,9 @@ export default function FavoritesMapPage() {
415
526
  ? "Buscando…"
416
527
  : gymCount != null
417
528
  ? gymsVisible
418
- ? `🏋️ Ocultar (${gymCount})`
419
- : `🏋️ Mostrar (${gymCount})`
420
- : "🏋️ Gimnasios"}
529
+ ? `Ocultar gyms (${gymCount})`
530
+ : `Mostrar gyms (${gymCount})`
531
+ : "Gimnasios"}
421
532
  </button>
422
533
  <button
423
534
  type="button"
@@ -428,7 +539,7 @@ export default function FavoritesMapPage() {
428
539
  : "border-neutral-300 hover:bg-neutral-100 dark:border-neutral-700 dark:hover:bg-neutral-800"
429
540
  }`}
430
541
  >
431
- Sincronizar con PF
542
+ Sincronizar con PF
432
543
  </button>
433
544
  </div>
434
545
  {errors.length > 0 && (
@@ -454,7 +565,7 @@ export default function FavoritesMapPage() {
454
565
  className="mx-0.5 inline-block cursor-grab rounded bg-neutral-900 px-2 py-0.5 font-bold text-white dark:bg-white dark:text-neutral-900"
455
566
  draggable
456
567
  >
457
- 📌 Guardados Brickwise
568
+ Guardados a Brickwise
458
569
  </a>
459
570
  </li>
460
571
  <li>
@@ -471,7 +582,7 @@ export default function FavoritesMapPage() {
471
582
  onClick={pasteFromPf}
472
583
  className="rounded bg-blue-600 px-2 py-0.5 font-bold text-white hover:bg-blue-500"
473
584
  >
474
- 📋 Pegar de Property Finder
585
+ Pegar de Property Finder
475
586
  </button>
476
587
  </li>
477
588
  </ol>
@@ -488,103 +599,62 @@ export default function FavoritesMapPage() {
488
599
  <p className="animate-pulse p-4 text-sm text-neutral-500">Cargando…</p>
489
600
  ) : rows.length === 0 ? (
490
601
  <p className="p-4 text-sm text-neutral-500">
491
- No hay favoritos aún. Pega arriba un enlace de Property Finder o guarda inmuebles desde{" "}
492
- <Link href="/search" className="font-semibold text-blue-600 hover:underline dark:text-blue-400">
493
- Buscar
494
- </Link>
495
- .
602
+ No hay favoritos aún. Pega arriba un enlace de Property Finder o usa Sincronizar con PF.
496
603
  </p>
497
604
  ) : (
498
- rows.map((r) => (
499
- <div
500
- key={r.id}
501
- id={`fav-${r.id}`}
502
- onMouseEnter={() => setHoveredId(r.id)}
503
- onMouseLeave={() => setHoveredId(null)}
504
- className={`border-b border-neutral-100 p-3 transition-colors dark:border-neutral-800 ${
505
- hoveredId === r.id ? "bg-blue-50 dark:bg-neutral-800" : ""
506
- }`}
507
- >
508
- <div className="flex gap-3">
509
- {r.images?.[0] && (
510
- // eslint-disable-next-line @next/next/no-img-element
511
- <img
512
- src={r.images[0].small}
513
- alt=""
514
- onClick={() => focus(r)}
515
- className="h-16 w-24 shrink-0 cursor-pointer rounded-lg object-cover"
516
- loading="lazy"
517
- />
518
- )}
519
- <div className="min-w-0 flex-1">
520
- <div className="flex items-start justify-between gap-2">
605
+ <>
606
+ {/* sort + bedroom filter */}
607
+ <div className="sticky top-0 z-10 flex flex-wrap items-center gap-1.5 border-b border-neutral-200 bg-white/95 px-3 py-2 backdrop-blur dark:border-neutral-800 dark:bg-neutral-900/95">
608
+ <span className="btn-font text-[10px] text-neutral-500">Ordenar</span>
609
+ {(["yield", "price"] as const).map((k) => (
610
+ <button
611
+ key={k}
612
+ onClick={() => setSortBy(k)}
613
+ className={`rounded px-2 py-0.5 text-[11px] ${
614
+ sortBy === k
615
+ ? "bg-neutral-900 text-white dark:bg-white dark:text-neutral-900"
616
+ : "border border-neutral-300 text-neutral-600 dark:border-neutral-700 dark:text-neutral-300"
617
+ }`}
618
+ >
619
+ {k === "yield" ? "Rentabilidad" : "Precio"}
620
+ </button>
621
+ ))}
622
+ {bedOptions.length > 0 && (
623
+ <>
624
+ <span className="btn-font ml-2 text-[10px] text-neutral-500">Hab</span>
625
+ {bedOptions.map((b) => (
521
626
  <button
522
- onClick={() => focus(r)}
523
- className="line-clamp-1 text-left text-sm font-semibold hover:underline"
524
- title="Centrar en el mapa"
627
+ key={b}
628
+ onClick={() => toggleBed(b)}
629
+ className={`rounded px-2 py-0.5 text-[11px] ${
630
+ bedFilter.includes(b)
631
+ ? "bg-blue-600 text-white"
632
+ : "border border-neutral-300 text-neutral-600 dark:border-neutral-700 dark:text-neutral-300"
633
+ }`}
525
634
  >
526
- {r.title}
635
+ {bedLabel(b)}
527
636
  </button>
528
- <button
529
- onClick={() => remove(r.id)}
530
- title="Quitar de favoritos"
531
- className="shrink-0 rounded-md px-1.5 text-xs text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-950"
532
- >
533
-
637
+ ))}
638
+ {bedFilter.length > 0 && (
639
+ <button onClick={() => setBedFilter([])} className="px-1 text-[11px] text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200">
640
+ Limpiar
534
641
  </button>
535
- </div>
536
- <div className="truncate text-xs text-neutral-500">
537
- {r.tower_name} · {r.bedrooms === 0 ? "Studio" : `${r.bedrooms ?? "?"} hab`} / {r.bathrooms ?? "?"} baños ·{" "}
538
- {fmtSqft(r.size_sqft)}
539
- </div>
540
- <div className="mt-1 flex items-center gap-2">
541
- <YieldBadge value={r.gross_yield} n={r.rent_n ?? undefined} />
542
- {r.asking_yield != null && (
543
- <span className="text-xs text-neutral-500">
544
- s/ anuncio: {(r.asking_yield * 100).toFixed(1)} %
545
- </span>
546
- )}
547
- </div>
548
- </div>
549
- </div>
550
-
551
- <div className="mt-2 grid grid-cols-2 gap-x-4 gap-y-0.5 text-xs text-neutral-600 dark:text-neutral-400">
552
- <span>
553
- Precio: <b className="text-neutral-900 dark:text-neutral-100">{fmtAED(r.price)}</b>
554
- </span>
555
- <span>AED/sqft: {r.price_per_sqft ? Math.round(r.price_per_sqft) : "—"}</span>
556
- <span>
557
- Renta mediana: {fmtAED(r.median_rent)}
558
- {r.rent_n ? ` (${r.rent_n})` : ""}
559
- </span>
560
- <span>
561
- Venta mediana: {fmtAED(r.median_sale_price)}
562
- {r.buy_n ? ` (${r.buy_n})` : ""}
563
- </span>
564
- <span title={r.gym_name ?? undefined}>Gym: {fmtDist(r.gym_distance_m)}</span>
565
- <span className="flex gap-2">
566
- <Link href={`/listing/${r.id}`} className="font-medium text-blue-600 hover:underline dark:text-blue-400">
567
- Ver análisis
568
- </Link>
569
- <a
570
- href={r.url}
571
- target="_blank"
572
- rel="noopener noreferrer"
573
- className="font-medium text-blue-600 hover:underline dark:text-blue-400"
574
- >
575
- PF ↗
576
- </a>
577
- </span>
578
- </div>
579
-
580
- <textarea
581
- className="mt-2 h-9 w-full resize-none rounded-md border border-transparent bg-neutral-50 px-2 py-1 text-xs outline-none focus:border-neutral-300 dark:bg-neutral-950 dark:focus:border-neutral-700"
582
- defaultValue={r.notes}
583
- placeholder="notas…"
584
- onBlur={(e) => saveNotes(r.id, e.target.value)}
585
- />
642
+ )}
643
+ </>
644
+ )}
586
645
  </div>
587
- ))
646
+
647
+ {visible.map((r) => renderCard(r))}
648
+
649
+ {bedFilter.length > 0 && dimmed.length > 0 && (
650
+ <>
651
+ <div className="btn-font border-y border-neutral-200 bg-neutral-100 px-3 py-1.5 text-[10px] text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950">
652
+ No coinciden con el filtro ({dimmed.length})
653
+ </div>
654
+ {dimmed.map((r) => renderCard(r, true))}
655
+ </>
656
+ )}
657
+ </>
588
658
  )}
589
659
  </div>
590
660
  </aside>