2026-02-28 17:18:24 +04:00
|
|
|
<div class="region-selector">
|
|
|
|
|
<button class="region-trigger" (click)="toggleDropdown()" [class.active]="dropdownOpen()">
|
2026-07-20 02:45:37 +04:00
|
|
|
<app-icon name="mapPin" [size]="16" class="pin-icon" />
|
2026-02-28 17:18:24 +04:00
|
|
|
<span class="region-name">
|
|
|
|
|
@if (detecting()) {
|
|
|
|
|
<span class="detecting">...</span>
|
|
|
|
|
} @else if (region()) {
|
|
|
|
|
{{ region()!.city }}
|
|
|
|
|
} @else {
|
|
|
|
|
{{ 'location.allRegions' | translate }}
|
|
|
|
|
}
|
|
|
|
|
</span>
|
2026-07-20 02:45:37 +04:00
|
|
|
<app-icon name="chevronDown" [size]="14" [class.rotated]="dropdownOpen()" class="chevron" />
|
2026-02-28 17:18:24 +04:00
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
@if (dropdownOpen()) {
|
|
|
|
|
<div class="region-dropdown">
|
|
|
|
|
<div class="dropdown-header">
|
|
|
|
|
<span>{{ 'location.chooseRegion' | translate }}</span>
|
|
|
|
|
@if (!detecting()) {
|
|
|
|
|
<button class="detect-btn" (click)="detectLocation()" title="{{ 'location.detectAuto' | translate }}">
|
2026-07-20 02:45:37 +04:00
|
|
|
<app-icon name="locate" [size]="14" />
|
2026-02-28 17:18:24 +04:00
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="region-list">
|
|
|
|
|
<button class="region-option" [class.selected]="!region()" (click)="selectGlobal()">
|
2026-07-20 02:45:37 +04:00
|
|
|
<app-icon name="globe" [size]="14" />
|
2026-02-28 17:18:24 +04:00
|
|
|
<span>{{ 'location.allRegions' | translate }}</span>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
@for (r of regions(); track r.id) {
|
|
|
|
|
<button class="region-option" [class.selected]="region()?.id === r.id" (click)="selectRegion(r)">
|
|
|
|
|
<span class="region-city">{{ r.city }}</span>
|
|
|
|
|
<span class="region-country">{{ r.country }}</span>
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</div>
|