feat: SEO improvements and image optimization
- Enhanced SEO service with meta tags and structured data - Updated sitemap service and robots.txt - Optimized listing components for better SEO - Compressed images (saved ~31MB total) - Added .gitattributes to enforce LF line endings Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
@ -26,7 +26,9 @@
|
||||||
"Bash(ls:*)",
|
"Bash(ls:*)",
|
||||||
"WebFetch(domain:angular.dev)",
|
"WebFetch(domain:angular.dev)",
|
||||||
"Bash(killall:*)",
|
"Bash(killall:*)",
|
||||||
"Bash(echo:*)"
|
"Bash(echo:*)",
|
||||||
|
"Bash(npm run build:*)",
|
||||||
|
"Bash(npx tsc:*)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
* text=auto eol=lf
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
|
@ -1,362 +1,362 @@
|
||||||
import { Inject, Injectable } from '@nestjs/common';
|
import { Inject, Injectable } from '@nestjs/common';
|
||||||
import { eq, sql } from 'drizzle-orm';
|
import { eq, sql } from 'drizzle-orm';
|
||||||
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
||||||
import * as schema from '../drizzle/schema';
|
import * as schema from '../drizzle/schema';
|
||||||
import { PG_CONNECTION } from '../drizzle/schema';
|
import { PG_CONNECTION } from '../drizzle/schema';
|
||||||
|
|
||||||
interface SitemapUrl {
|
interface SitemapUrl {
|
||||||
loc: string;
|
loc: string;
|
||||||
lastmod?: string;
|
lastmod?: string;
|
||||||
changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
||||||
priority?: number;
|
priority?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SitemapIndexEntry {
|
interface SitemapIndexEntry {
|
||||||
loc: string;
|
loc: string;
|
||||||
lastmod?: string;
|
lastmod?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SitemapService {
|
export class SitemapService {
|
||||||
private readonly baseUrl = 'https://biz-match.com';
|
private readonly baseUrl = 'https://www.bizmatch.net';
|
||||||
private readonly URLS_PER_SITEMAP = 10000; // Google best practice
|
private readonly URLS_PER_SITEMAP = 10000; // Google best practice
|
||||||
|
|
||||||
constructor(@Inject(PG_CONNECTION) private readonly db: NodePgDatabase<typeof schema>) { }
|
constructor(@Inject(PG_CONNECTION) private readonly db: NodePgDatabase<typeof schema>) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate sitemap index (main sitemap.xml)
|
* Generate sitemap index (main sitemap.xml)
|
||||||
* Lists all sitemap files: static, business-1, business-2, commercial-1, etc.
|
* Lists all sitemap files: static, business-1, business-2, commercial-1, etc.
|
||||||
*/
|
*/
|
||||||
async generateSitemapIndex(): Promise<string> {
|
async generateSitemapIndex(): Promise<string> {
|
||||||
const sitemaps: SitemapIndexEntry[] = [];
|
const sitemaps: SitemapIndexEntry[] = [];
|
||||||
|
|
||||||
// Add static pages sitemap
|
// Add static pages sitemap
|
||||||
sitemaps.push({
|
sitemaps.push({
|
||||||
loc: `${this.baseUrl}/bizmatch/sitemap/static.xml`,
|
loc: `${this.baseUrl}/bizmatch/sitemap/static.xml`,
|
||||||
lastmod: this.formatDate(new Date()),
|
lastmod: this.formatDate(new Date()),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Count business listings
|
// Count business listings
|
||||||
const businessCount = await this.getBusinessListingsCount();
|
const businessCount = await this.getBusinessListingsCount();
|
||||||
const businessPages = Math.ceil(businessCount / this.URLS_PER_SITEMAP) || 1;
|
const businessPages = Math.ceil(businessCount / this.URLS_PER_SITEMAP) || 1;
|
||||||
for (let page = 1; page <= businessPages; page++) {
|
for (let page = 1; page <= businessPages; page++) {
|
||||||
sitemaps.push({
|
sitemaps.push({
|
||||||
loc: `${this.baseUrl}/bizmatch/sitemap/business-${page}.xml`,
|
loc: `${this.baseUrl}/bizmatch/sitemap/business-${page}.xml`,
|
||||||
lastmod: this.formatDate(new Date()),
|
lastmod: this.formatDate(new Date()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count commercial property listings
|
// Count commercial property listings
|
||||||
const commercialCount = await this.getCommercialPropertiesCount();
|
const commercialCount = await this.getCommercialPropertiesCount();
|
||||||
const commercialPages = Math.ceil(commercialCount / this.URLS_PER_SITEMAP) || 1;
|
const commercialPages = Math.ceil(commercialCount / this.URLS_PER_SITEMAP) || 1;
|
||||||
for (let page = 1; page <= commercialPages; page++) {
|
for (let page = 1; page <= commercialPages; page++) {
|
||||||
sitemaps.push({
|
sitemaps.push({
|
||||||
loc: `${this.baseUrl}/bizmatch/sitemap/commercial-${page}.xml`,
|
loc: `${this.baseUrl}/bizmatch/sitemap/commercial-${page}.xml`,
|
||||||
lastmod: this.formatDate(new Date()),
|
lastmod: this.formatDate(new Date()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count broker profiles
|
// Count broker profiles
|
||||||
const brokerCount = await this.getBrokerProfilesCount();
|
const brokerCount = await this.getBrokerProfilesCount();
|
||||||
const brokerPages = Math.ceil(brokerCount / this.URLS_PER_SITEMAP) || 1;
|
const brokerPages = Math.ceil(brokerCount / this.URLS_PER_SITEMAP) || 1;
|
||||||
for (let page = 1; page <= brokerPages; page++) {
|
for (let page = 1; page <= brokerPages; page++) {
|
||||||
sitemaps.push({
|
sitemaps.push({
|
||||||
loc: `${this.baseUrl}/bizmatch/sitemap/brokers-${page}.xml`,
|
loc: `${this.baseUrl}/bizmatch/sitemap/brokers-${page}.xml`,
|
||||||
lastmod: this.formatDate(new Date()),
|
lastmod: this.formatDate(new Date()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.buildXmlSitemapIndex(sitemaps);
|
return this.buildXmlSitemapIndex(sitemaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate static pages sitemap
|
* Generate static pages sitemap
|
||||||
*/
|
*/
|
||||||
async generateStaticSitemap(): Promise<string> {
|
async generateStaticSitemap(): Promise<string> {
|
||||||
const urls = this.getStaticPageUrls();
|
const urls = this.getStaticPageUrls();
|
||||||
return this.buildXmlSitemap(urls);
|
return this.buildXmlSitemap(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate business listings sitemap (paginated)
|
* Generate business listings sitemap (paginated)
|
||||||
*/
|
*/
|
||||||
async generateBusinessSitemap(page: number): Promise<string> {
|
async generateBusinessSitemap(page: number): Promise<string> {
|
||||||
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
||||||
const urls = await this.getBusinessListingUrls(offset, this.URLS_PER_SITEMAP);
|
const urls = await this.getBusinessListingUrls(offset, this.URLS_PER_SITEMAP);
|
||||||
return this.buildXmlSitemap(urls);
|
return this.buildXmlSitemap(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate commercial property sitemap (paginated)
|
* Generate commercial property sitemap (paginated)
|
||||||
*/
|
*/
|
||||||
async generateCommercialSitemap(page: number): Promise<string> {
|
async generateCommercialSitemap(page: number): Promise<string> {
|
||||||
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
||||||
const urls = await this.getCommercialPropertyUrls(offset, this.URLS_PER_SITEMAP);
|
const urls = await this.getCommercialPropertyUrls(offset, this.URLS_PER_SITEMAP);
|
||||||
return this.buildXmlSitemap(urls);
|
return this.buildXmlSitemap(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build XML sitemap index
|
* Build XML sitemap index
|
||||||
*/
|
*/
|
||||||
private buildXmlSitemapIndex(sitemaps: SitemapIndexEntry[]): string {
|
private buildXmlSitemapIndex(sitemaps: SitemapIndexEntry[]): string {
|
||||||
const sitemapElements = sitemaps
|
const sitemapElements = sitemaps
|
||||||
.map(sitemap => {
|
.map(sitemap => {
|
||||||
let element = ` <sitemap>\n <loc>${sitemap.loc}</loc>`;
|
let element = ` <sitemap>\n <loc>${sitemap.loc}</loc>`;
|
||||||
if (sitemap.lastmod) {
|
if (sitemap.lastmod) {
|
||||||
element += `\n <lastmod>${sitemap.lastmod}</lastmod>`;
|
element += `\n <lastmod>${sitemap.lastmod}</lastmod>`;
|
||||||
}
|
}
|
||||||
element += '\n </sitemap>';
|
element += '\n </sitemap>';
|
||||||
return element;
|
return element;
|
||||||
})
|
})
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
${sitemapElements}
|
${sitemapElements}
|
||||||
</sitemapindex>`;
|
</sitemapindex>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build XML sitemap string
|
* Build XML sitemap string
|
||||||
*/
|
*/
|
||||||
private buildXmlSitemap(urls: SitemapUrl[]): string {
|
private buildXmlSitemap(urls: SitemapUrl[]): string {
|
||||||
const urlElements = urls.map(url => this.buildUrlElement(url)).join('\n ');
|
const urlElements = urls.map(url => this.buildUrlElement(url)).join('\n ');
|
||||||
|
|
||||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
${urlElements}
|
${urlElements}
|
||||||
</urlset>`;
|
</urlset>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build single URL element
|
* Build single URL element
|
||||||
*/
|
*/
|
||||||
private buildUrlElement(url: SitemapUrl): string {
|
private buildUrlElement(url: SitemapUrl): string {
|
||||||
let element = `<url>\n <loc>${url.loc}</loc>`;
|
let element = `<url>\n <loc>${url.loc}</loc>`;
|
||||||
|
|
||||||
if (url.lastmod) {
|
if (url.lastmod) {
|
||||||
element += `\n <lastmod>${url.lastmod}</lastmod>`;
|
element += `\n <lastmod>${url.lastmod}</lastmod>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.changefreq) {
|
if (url.changefreq) {
|
||||||
element += `\n <changefreq>${url.changefreq}</changefreq>`;
|
element += `\n <changefreq>${url.changefreq}</changefreq>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.priority !== undefined) {
|
if (url.priority !== undefined) {
|
||||||
element += `\n <priority>${url.priority.toFixed(1)}</priority>`;
|
element += `\n <priority>${url.priority.toFixed(1)}</priority>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
element += '\n </url>';
|
element += '\n </url>';
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get static page URLs
|
* Get static page URLs
|
||||||
*/
|
*/
|
||||||
private getStaticPageUrls(): SitemapUrl[] {
|
private getStaticPageUrls(): SitemapUrl[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/`,
|
loc: `${this.baseUrl}/`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 1.0,
|
priority: 1.0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/home`,
|
loc: `${this.baseUrl}/home`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 1.0,
|
priority: 1.0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/businessListings`,
|
loc: `${this.baseUrl}/businessListings`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.9,
|
priority: 0.9,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/commercialPropertyListings`,
|
loc: `${this.baseUrl}/commercialPropertyListings`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.9,
|
priority: 0.9,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/brokerListings`,
|
loc: `${this.baseUrl}/brokerListings`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.8,
|
priority: 0.8,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/terms-of-use`,
|
loc: `${this.baseUrl}/terms-of-use`,
|
||||||
changefreq: 'monthly',
|
changefreq: 'monthly',
|
||||||
priority: 0.5,
|
priority: 0.5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/privacy-statement`,
|
loc: `${this.baseUrl}/privacy-statement`,
|
||||||
changefreq: 'monthly',
|
changefreq: 'monthly',
|
||||||
priority: 0.5,
|
priority: 0.5,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count business listings (non-draft)
|
* Count business listings (non-draft)
|
||||||
*/
|
*/
|
||||||
private async getBusinessListingsCount(): Promise<number> {
|
private async getBusinessListingsCount(): Promise<number> {
|
||||||
try {
|
try {
|
||||||
const result = await this.db
|
const result = await this.db
|
||||||
.select({ count: sql<number>`count(*)` })
|
.select({ count: sql<number>`count(*)` })
|
||||||
.from(schema.businesses_json)
|
.from(schema.businesses_json)
|
||||||
.where(sql`(${schema.businesses_json.data}->>'draft')::boolean IS NOT TRUE`);
|
.where(sql`(${schema.businesses_json.data}->>'draft')::boolean IS NOT TRUE`);
|
||||||
|
|
||||||
return Number(result[0]?.count || 0);
|
return Number(result[0]?.count || 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error counting business listings:', error);
|
console.error('Error counting business listings:', error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count commercial properties (non-draft)
|
* Count commercial properties (non-draft)
|
||||||
*/
|
*/
|
||||||
private async getCommercialPropertiesCount(): Promise<number> {
|
private async getCommercialPropertiesCount(): Promise<number> {
|
||||||
try {
|
try {
|
||||||
const result = await this.db
|
const result = await this.db
|
||||||
.select({ count: sql<number>`count(*)` })
|
.select({ count: sql<number>`count(*)` })
|
||||||
.from(schema.commercials_json)
|
.from(schema.commercials_json)
|
||||||
.where(sql`(${schema.commercials_json.data}->>'draft')::boolean IS NOT TRUE`);
|
.where(sql`(${schema.commercials_json.data}->>'draft')::boolean IS NOT TRUE`);
|
||||||
|
|
||||||
return Number(result[0]?.count || 0);
|
return Number(result[0]?.count || 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error counting commercial properties:', error);
|
console.error('Error counting commercial properties:', error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get business listing URLs from database (paginated, slug-based)
|
* Get business listing URLs from database (paginated, slug-based)
|
||||||
*/
|
*/
|
||||||
private async getBusinessListingUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
private async getBusinessListingUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
||||||
try {
|
try {
|
||||||
const listings = await this.db
|
const listings = await this.db
|
||||||
.select({
|
.select({
|
||||||
id: schema.businesses_json.id,
|
id: schema.businesses_json.id,
|
||||||
slug: sql<string>`${schema.businesses_json.data}->>'slug'`,
|
slug: sql<string>`${schema.businesses_json.data}->>'slug'`,
|
||||||
updated: sql<Date>`(${schema.businesses_json.data}->>'updated')::timestamptz`,
|
updated: sql<Date>`(${schema.businesses_json.data}->>'updated')::timestamptz`,
|
||||||
created: sql<Date>`(${schema.businesses_json.data}->>'created')::timestamptz`,
|
created: sql<Date>`(${schema.businesses_json.data}->>'created')::timestamptz`,
|
||||||
})
|
})
|
||||||
.from(schema.businesses_json)
|
.from(schema.businesses_json)
|
||||||
.where(sql`(${schema.businesses_json.data}->>'draft')::boolean IS NOT TRUE`)
|
.where(sql`(${schema.businesses_json.data}->>'draft')::boolean IS NOT TRUE`)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset);
|
.offset(offset);
|
||||||
|
|
||||||
return listings.map(listing => {
|
return listings.map(listing => {
|
||||||
const urlSlug = listing.slug || listing.id;
|
const urlSlug = listing.slug || listing.id;
|
||||||
return {
|
return {
|
||||||
loc: `${this.baseUrl}/business/${urlSlug}`,
|
loc: `${this.baseUrl}/business/${urlSlug}`,
|
||||||
lastmod: this.formatDate(listing.updated || listing.created),
|
lastmod: this.formatDate(listing.updated || listing.created),
|
||||||
changefreq: 'weekly' as const,
|
changefreq: 'weekly' as const,
|
||||||
priority: 0.8,
|
priority: 0.8,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching business listings for sitemap:', error);
|
console.error('Error fetching business listings for sitemap:', error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get commercial property URLs from database (paginated, slug-based)
|
* Get commercial property URLs from database (paginated, slug-based)
|
||||||
*/
|
*/
|
||||||
private async getCommercialPropertyUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
private async getCommercialPropertyUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
||||||
try {
|
try {
|
||||||
const properties = await this.db
|
const properties = await this.db
|
||||||
.select({
|
.select({
|
||||||
id: schema.commercials_json.id,
|
id: schema.commercials_json.id,
|
||||||
slug: sql<string>`${schema.commercials_json.data}->>'slug'`,
|
slug: sql<string>`${schema.commercials_json.data}->>'slug'`,
|
||||||
updated: sql<Date>`(${schema.commercials_json.data}->>'updated')::timestamptz`,
|
updated: sql<Date>`(${schema.commercials_json.data}->>'updated')::timestamptz`,
|
||||||
created: sql<Date>`(${schema.commercials_json.data}->>'created')::timestamptz`,
|
created: sql<Date>`(${schema.commercials_json.data}->>'created')::timestamptz`,
|
||||||
})
|
})
|
||||||
.from(schema.commercials_json)
|
.from(schema.commercials_json)
|
||||||
.where(sql`(${schema.commercials_json.data}->>'draft')::boolean IS NOT TRUE`)
|
.where(sql`(${schema.commercials_json.data}->>'draft')::boolean IS NOT TRUE`)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset);
|
.offset(offset);
|
||||||
|
|
||||||
return properties.map(property => {
|
return properties.map(property => {
|
||||||
const urlSlug = property.slug || property.id;
|
const urlSlug = property.slug || property.id;
|
||||||
return {
|
return {
|
||||||
loc: `${this.baseUrl}/commercial-property/${urlSlug}`,
|
loc: `${this.baseUrl}/commercial-property/${urlSlug}`,
|
||||||
lastmod: this.formatDate(property.updated || property.created),
|
lastmod: this.formatDate(property.updated || property.created),
|
||||||
changefreq: 'weekly' as const,
|
changefreq: 'weekly' as const,
|
||||||
priority: 0.8,
|
priority: 0.8,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching commercial properties for sitemap:', error);
|
console.error('Error fetching commercial properties for sitemap:', error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format date to ISO 8601 format (YYYY-MM-DD)
|
* Format date to ISO 8601 format (YYYY-MM-DD)
|
||||||
*/
|
*/
|
||||||
private formatDate(date: Date | string): string {
|
private formatDate(date: Date | string): string {
|
||||||
if (!date) return new Date().toISOString().split('T')[0];
|
if (!date) return new Date().toISOString().split('T')[0];
|
||||||
const d = typeof date === 'string' ? new Date(date) : date;
|
const d = typeof date === 'string' ? new Date(date) : date;
|
||||||
return d.toISOString().split('T')[0];
|
return d.toISOString().split('T')[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate broker profiles sitemap (paginated)
|
* Generate broker profiles sitemap (paginated)
|
||||||
*/
|
*/
|
||||||
async generateBrokerSitemap(page: number): Promise<string> {
|
async generateBrokerSitemap(page: number): Promise<string> {
|
||||||
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
const offset = (page - 1) * this.URLS_PER_SITEMAP;
|
||||||
const urls = await this.getBrokerProfileUrls(offset, this.URLS_PER_SITEMAP);
|
const urls = await this.getBrokerProfileUrls(offset, this.URLS_PER_SITEMAP);
|
||||||
return this.buildXmlSitemap(urls);
|
return this.buildXmlSitemap(urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count broker profiles (professionals with showInDirectory=true)
|
* Count broker profiles (professionals with showInDirectory=true)
|
||||||
*/
|
*/
|
||||||
private async getBrokerProfilesCount(): Promise<number> {
|
private async getBrokerProfilesCount(): Promise<number> {
|
||||||
try {
|
try {
|
||||||
const result = await this.db
|
const result = await this.db
|
||||||
.select({ count: sql<number>`count(*)` })
|
.select({ count: sql<number>`count(*)` })
|
||||||
.from(schema.users_json)
|
.from(schema.users_json)
|
||||||
.where(sql`
|
.where(sql`
|
||||||
(${schema.users_json.data}->>'customerType') = 'professional'
|
(${schema.users_json.data}->>'customerType') = 'professional'
|
||||||
AND (${schema.users_json.data}->>'showInDirectory')::boolean IS TRUE
|
AND (${schema.users_json.data}->>'showInDirectory')::boolean IS TRUE
|
||||||
`);
|
`);
|
||||||
|
|
||||||
return Number(result[0]?.count || 0);
|
return Number(result[0]?.count || 0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error counting broker profiles:', error);
|
console.error('Error counting broker profiles:', error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get broker profile URLs from database (paginated)
|
* Get broker profile URLs from database (paginated)
|
||||||
*/
|
*/
|
||||||
private async getBrokerProfileUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
private async getBrokerProfileUrls(offset: number, limit: number): Promise<SitemapUrl[]> {
|
||||||
try {
|
try {
|
||||||
const brokers = await this.db
|
const brokers = await this.db
|
||||||
.select({
|
.select({
|
||||||
email: schema.users_json.email,
|
email: schema.users_json.email,
|
||||||
updated: sql<Date>`(${schema.users_json.data}->>'updated')::timestamptz`,
|
updated: sql<Date>`(${schema.users_json.data}->>'updated')::timestamptz`,
|
||||||
created: sql<Date>`(${schema.users_json.data}->>'created')::timestamptz`,
|
created: sql<Date>`(${schema.users_json.data}->>'created')::timestamptz`,
|
||||||
})
|
})
|
||||||
.from(schema.users_json)
|
.from(schema.users_json)
|
||||||
.where(sql`
|
.where(sql`
|
||||||
(${schema.users_json.data}->>'customerType') = 'professional'
|
(${schema.users_json.data}->>'customerType') = 'professional'
|
||||||
AND (${schema.users_json.data}->>'showInDirectory')::boolean IS TRUE
|
AND (${schema.users_json.data}->>'showInDirectory')::boolean IS TRUE
|
||||||
`)
|
`)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset);
|
.offset(offset);
|
||||||
|
|
||||||
return brokers.map(broker => ({
|
return brokers.map(broker => ({
|
||||||
loc: `${this.baseUrl}/details-user/${encodeURIComponent(broker.email)}`,
|
loc: `${this.baseUrl}/details-user/${encodeURIComponent(broker.email)}`,
|
||||||
lastmod: this.formatDate(broker.updated || broker.created),
|
lastmod: this.formatDate(broker.updated || broker.created),
|
||||||
changefreq: 'weekly' as const,
|
changefreq: 'weekly' as const,
|
||||||
priority: 0.7,
|
priority: 0.7,
|
||||||
}));
|
}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching broker profiles for sitemap:', error);
|
console.error('Error fetching broker profiles for sitemap:', error);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,193 +1,194 @@
|
||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { LogoutComponent } from './components/logout/logout.component';
|
// Core components (eagerly loaded - needed for initial navigation)
|
||||||
import { NotFoundComponent } from './components/not-found/not-found.component';
|
import { LogoutComponent } from './components/logout/logout.component';
|
||||||
import { TestSsrComponent } from './components/test-ssr/test-ssr.component';
|
import { NotFoundComponent } from './components/not-found/not-found.component';
|
||||||
|
import { TestSsrComponent } from './components/test-ssr/test-ssr.component';
|
||||||
import { EmailAuthorizedComponent } from './components/email-authorized/email-authorized.component';
|
import { EmailAuthorizedComponent } from './components/email-authorized/email-authorized.component';
|
||||||
import { EmailVerificationComponent } from './components/email-verification/email-verification.component';
|
import { EmailVerificationComponent } from './components/email-verification/email-verification.component';
|
||||||
import { LoginRegisterComponent } from './components/login-register/login-register.component';
|
import { LoginRegisterComponent } from './components/login-register/login-register.component';
|
||||||
import { AuthGuard } from './guards/auth.guard';
|
|
||||||
import { ListingCategoryGuard } from './guards/listing-category.guard';
|
// Guards
|
||||||
import { UserListComponent } from './pages/admin/user-list/user-list.component';
|
import { AuthGuard } from './guards/auth.guard';
|
||||||
import { DetailsBusinessListingComponent } from './pages/details/details-business-listing/details-business-listing.component';
|
import { ListingCategoryGuard } from './guards/listing-category.guard';
|
||||||
import { DetailsCommercialPropertyListingComponent } from './pages/details/details-commercial-property-listing/details-commercial-property-listing.component';
|
|
||||||
import { DetailsUserComponent } from './pages/details/details-user/details-user.component';
|
// Public pages (eagerly loaded - high traffic)
|
||||||
import { HomeComponent } from './pages/home/home.component';
|
import { DetailsBusinessListingComponent } from './pages/details/details-business-listing/details-business-listing.component';
|
||||||
import { BrokerListingsComponent } from './pages/listings/broker-listings/broker-listings.component';
|
import { DetailsCommercialPropertyListingComponent } from './pages/details/details-commercial-property-listing/details-commercial-property-listing.component';
|
||||||
import { BusinessListingsComponent } from './pages/listings/business-listings/business-listings.component';
|
import { DetailsUserComponent } from './pages/details/details-user/details-user.component';
|
||||||
import { CommercialPropertyListingsComponent } from './pages/listings/commercial-property-listings/commercial-property-listings.component';
|
import { HomeComponent } from './pages/home/home.component';
|
||||||
import { AccountComponent } from './pages/subscription/account/account.component';
|
import { BrokerListingsComponent } from './pages/listings/broker-listings/broker-listings.component';
|
||||||
import { EditBusinessListingComponent } from './pages/subscription/edit-business-listing/edit-business-listing.component';
|
import { BusinessListingsComponent } from './pages/listings/business-listings/business-listings.component';
|
||||||
import { EditCommercialPropertyListingComponent } from './pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component';
|
import { CommercialPropertyListingsComponent } from './pages/listings/commercial-property-listings/commercial-property-listings.component';
|
||||||
import { EmailUsComponent } from './pages/subscription/email-us/email-us.component';
|
import { SuccessComponent } from './pages/success/success.component';
|
||||||
import { FavoritesComponent } from './pages/subscription/favorites/favorites.component';
|
import { TermsOfUseComponent } from './pages/legal/terms-of-use.component';
|
||||||
import { MyListingComponent } from './pages/subscription/my-listing/my-listing.component';
|
import { PrivacyStatementComponent } from './pages/legal/privacy-statement.component';
|
||||||
import { SuccessComponent } from './pages/success/success.component';
|
|
||||||
import { TermsOfUseComponent } from './pages/legal/terms-of-use.component';
|
// Note: Account, Edit, Admin, Favorites, MyListing, and EmailUs components are now lazy-loaded below
|
||||||
import { PrivacyStatementComponent } from './pages/legal/privacy-statement.component';
|
|
||||||
|
export const routes: Routes = [
|
||||||
export const routes: Routes = [
|
{
|
||||||
{
|
path: 'test-ssr',
|
||||||
path: 'test-ssr',
|
component: TestSsrComponent,
|
||||||
component: TestSsrComponent,
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'businessListings',
|
||||||
path: 'businessListings',
|
component: BusinessListingsComponent,
|
||||||
component: BusinessListingsComponent,
|
runGuardsAndResolvers: 'always',
|
||||||
runGuardsAndResolvers: 'always',
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'commercialPropertyListings',
|
||||||
path: 'commercialPropertyListings',
|
component: CommercialPropertyListingsComponent,
|
||||||
component: CommercialPropertyListingsComponent,
|
runGuardsAndResolvers: 'always',
|
||||||
runGuardsAndResolvers: 'always',
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'brokerListings',
|
||||||
path: 'brokerListings',
|
component: BrokerListingsComponent,
|
||||||
component: BrokerListingsComponent,
|
runGuardsAndResolvers: 'always',
|
||||||
runGuardsAndResolvers: 'always',
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'home',
|
||||||
path: 'home',
|
component: HomeComponent,
|
||||||
component: HomeComponent,
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// Listings Details - New SEO-friendly slug-based URLs
|
||||||
// Listings Details - New SEO-friendly slug-based URLs
|
{
|
||||||
{
|
path: 'business/:slug',
|
||||||
path: 'business/:slug',
|
component: DetailsBusinessListingComponent,
|
||||||
component: DetailsBusinessListingComponent,
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'commercial-property/:slug',
|
||||||
path: 'commercial-property/:slug',
|
component: DetailsCommercialPropertyListingComponent,
|
||||||
component: DetailsCommercialPropertyListingComponent,
|
},
|
||||||
},
|
// Backward compatibility redirects for old UUID-based URLs
|
||||||
// Backward compatibility redirects for old UUID-based URLs
|
{
|
||||||
{
|
path: 'details-business-listing/:id',
|
||||||
path: 'details-business-listing/:id',
|
redirectTo: 'business/:id',
|
||||||
redirectTo: 'business/:id',
|
pathMatch: 'full',
|
||||||
pathMatch: 'full',
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'details-commercial-property-listing/:id',
|
||||||
path: 'details-commercial-property-listing/:id',
|
redirectTo: 'commercial-property/:id',
|
||||||
redirectTo: 'commercial-property/:id',
|
pathMatch: 'full',
|
||||||
pathMatch: 'full',
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'listing/:id',
|
||||||
path: 'listing/:id',
|
canActivate: [ListingCategoryGuard],
|
||||||
canActivate: [ListingCategoryGuard],
|
component: NotFoundComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
||||||
component: NotFoundComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
},
|
||||||
},
|
// {
|
||||||
// {
|
// path: 'login/:page',
|
||||||
// path: 'login/:page',
|
// component: LoginComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
||||||
// component: LoginComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
// },
|
||||||
// },
|
{
|
||||||
{
|
path: 'login/:page',
|
||||||
path: 'login/:page',
|
component: LoginRegisterComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
||||||
component: LoginRegisterComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'login',
|
||||||
path: 'login',
|
component: LoginRegisterComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
||||||
component: LoginRegisterComponent, // Dummy-Komponente, wird nie angezeigt, da der Guard weiterleitet
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'notfound',
|
||||||
path: 'notfound',
|
component: NotFoundComponent,
|
||||||
component: NotFoundComponent,
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// User Details
|
||||||
// User Details
|
{
|
||||||
{
|
path: 'details-user/:id',
|
||||||
path: 'details-user/:id',
|
component: DetailsUserComponent,
|
||||||
component: DetailsUserComponent,
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// User edit (lazy-loaded)
|
||||||
// User edit
|
{
|
||||||
{
|
path: 'account',
|
||||||
path: 'account',
|
loadComponent: () => import('./pages/subscription/account/account.component').then(m => m.AccountComponent),
|
||||||
component: AccountComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'account/:id',
|
||||||
path: 'account/:id',
|
loadComponent: () => import('./pages/subscription/account/account.component').then(m => m.AccountComponent),
|
||||||
component: AccountComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// Create, Update Listings (lazy-loaded)
|
||||||
// Create, Update Listings
|
{
|
||||||
{
|
path: 'editBusinessListing/:id',
|
||||||
path: 'editBusinessListing/:id',
|
loadComponent: () => import('./pages/subscription/edit-business-listing/edit-business-listing.component').then(m => m.EditBusinessListingComponent),
|
||||||
component: EditBusinessListingComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'createBusinessListing',
|
||||||
path: 'createBusinessListing',
|
loadComponent: () => import('./pages/subscription/edit-business-listing/edit-business-listing.component').then(m => m.EditBusinessListingComponent),
|
||||||
component: EditBusinessListingComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'editCommercialPropertyListing/:id',
|
||||||
path: 'editCommercialPropertyListing/:id',
|
loadComponent: () => import('./pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component').then(m => m.EditCommercialPropertyListingComponent),
|
||||||
component: EditCommercialPropertyListingComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'createCommercialPropertyListing',
|
||||||
path: 'createCommercialPropertyListing',
|
loadComponent: () => import('./pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component').then(m => m.EditCommercialPropertyListingComponent),
|
||||||
component: EditCommercialPropertyListingComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// My Listings (lazy-loaded)
|
||||||
// My Listings
|
{
|
||||||
{
|
path: 'myListings',
|
||||||
path: 'myListings',
|
loadComponent: () => import('./pages/subscription/my-listing/my-listing.component').then(m => m.MyListingComponent),
|
||||||
component: MyListingComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// My Favorites (lazy-loaded)
|
||||||
// My Favorites
|
{
|
||||||
{
|
path: 'myFavorites',
|
||||||
path: 'myFavorites',
|
loadComponent: () => import('./pages/subscription/favorites/favorites.component').then(m => m.FavoritesComponent),
|
||||||
component: FavoritesComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// Email Us (lazy-loaded)
|
||||||
// EMAil Us
|
{
|
||||||
{
|
path: 'emailUs',
|
||||||
path: 'emailUs',
|
loadComponent: () => import('./pages/subscription/email-us/email-us.component').then(m => m.EmailUsComponent),
|
||||||
component: EmailUsComponent,
|
// canActivate: [AuthGuard],
|
||||||
// canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// Logout
|
||||||
// Logout
|
{
|
||||||
{
|
path: 'logout',
|
||||||
path: 'logout',
|
component: LogoutComponent,
|
||||||
component: LogoutComponent,
|
canActivate: [AuthGuard],
|
||||||
canActivate: [AuthGuard],
|
},
|
||||||
},
|
// #########
|
||||||
// #########
|
// Email Verification
|
||||||
// Email Verification
|
{
|
||||||
{
|
path: 'emailVerification',
|
||||||
path: 'emailVerification',
|
component: EmailVerificationComponent,
|
||||||
component: EmailVerificationComponent,
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'email-authorized',
|
||||||
path: 'email-authorized',
|
component: EmailAuthorizedComponent,
|
||||||
component: EmailAuthorizedComponent,
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'success',
|
||||||
path: 'success',
|
component: SuccessComponent,
|
||||||
component: SuccessComponent,
|
},
|
||||||
},
|
// #########
|
||||||
{
|
// Admin Pages (lazy-loaded)
|
||||||
path: 'admin/users',
|
{
|
||||||
component: UserListComponent,
|
path: 'admin/users',
|
||||||
canActivate: [AuthGuard],
|
loadComponent: () => import('./pages/admin/user-list/user-list.component').then(m => m.UserListComponent),
|
||||||
},
|
canActivate: [AuthGuard],
|
||||||
// #########
|
},
|
||||||
// Legal Pages
|
// #########
|
||||||
{
|
// Legal Pages
|
||||||
path: 'terms-of-use',
|
{
|
||||||
component: TermsOfUseComponent,
|
path: 'terms-of-use',
|
||||||
},
|
component: TermsOfUseComponent,
|
||||||
{
|
},
|
||||||
path: 'privacy-statement',
|
{
|
||||||
component: PrivacyStatementComponent,
|
path: 'privacy-statement',
|
||||||
},
|
component: PrivacyStatementComponent,
|
||||||
{ path: '**', redirectTo: 'home' },
|
},
|
||||||
];
|
{ path: '**', redirectTo: 'home' },
|
||||||
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,206 +1,253 @@
|
||||||
<header class="w-full flex justify-between items-center p-4 bg-white top-0 z-10 h-16 md:h-20">
|
<header class="w-full flex justify-between items-center p-4 bg-white top-0 z-10 h-16 md:h-20">
|
||||||
<img src="/assets/images/header-logo.png" alt="Logo" class="h-8 md:h-10 w-auto" />
|
<img src="/assets/images/header-logo.png" alt="Logo" class="h-8 md:h-10 w-auto" />
|
||||||
<div class="hidden md:flex items-center space-x-4">
|
<div class="hidden md:flex items-center space-x-4">
|
||||||
@if(user){
|
@if(user){
|
||||||
<a routerLink="/account" class="text-primary-600 border border-primary-600 px-3 py-2 rounded">Account</a>
|
<a routerLink="/account" class="text-primary-600 border border-primary-600 px-3 py-2 rounded">Account</a>
|
||||||
} @else {
|
} @else {
|
||||||
<!-- <a routerLink="/pricing" class="text-neutral-800">Pricing</a> -->
|
<!-- <a routerLink="/pricing" class="text-neutral-800">Pricing</a> -->
|
||||||
<a routerLink="/login" [queryParams]="{ mode: 'login' }" class="text-primary-600 border border-primary-600 px-3 py-2 rounded">Log In</a>
|
<a routerLink="/login" [queryParams]="{ mode: 'login' }" class="text-primary-600 border border-primary-600 px-3 py-2 rounded">Log In</a>
|
||||||
<a routerLink="/login" [queryParams]="{ mode: 'register' }" class="text-white bg-primary-600 px-4 py-2 rounded">Sign Up</a>
|
<a routerLink="/login" [queryParams]="{ mode: 'register' }" class="text-white bg-primary-600 px-4 py-2 rounded">Sign Up</a>
|
||||||
<!-- <a routerLink="/login" class="text-primary-500 hover:underline">Login/Register</a> -->
|
<!-- <a routerLink="/login" class="text-primary-500 hover:underline">Login/Register</a> -->
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<button (click)="toggleMenu()" class="md:hidden text-neutral-600">
|
<button
|
||||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
(click)="toggleMenu()"
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16m-7 6h7"></path>
|
class="md:hidden text-neutral-600"
|
||||||
</svg>
|
aria-label="Open navigation menu"
|
||||||
</button>
|
[attr.aria-expanded]="isMenuOpen"
|
||||||
</header>
|
>
|
||||||
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<div *ngIf="isMenuOpen" class="fixed inset-0 bg-neutral-800 bg-opacity-75 z-20">
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16m-7 6h7"></path>
|
||||||
<div class="flex flex-col items-center justify-center h-full">
|
</svg>
|
||||||
<!-- <a href="#" class="text-white text-xl py-2">Pricing</a> -->
|
</button>
|
||||||
@if(user){
|
</header>
|
||||||
<a routerLink="/account" class="text-white text-xl py-2">Account</a>
|
|
||||||
} @else {
|
<div *ngIf="isMenuOpen" class="fixed inset-0 bg-neutral-800 bg-opacity-75 z-20">
|
||||||
<a routerLink="/login" [queryParams]="{ mode: 'login' }" class="text-white text-xl py-2">Log In</a>
|
<div class="flex flex-col items-center justify-center h-full">
|
||||||
<a routerLink="/login" [queryParams]="{ mode: 'register' }" class="text-white text-xl py-2">Sign Up</a>
|
<!-- <a href="#" class="text-white text-xl py-2">Pricing</a> -->
|
||||||
}
|
@if(user){
|
||||||
<button (click)="toggleMenu()" class="text-white mt-4">
|
<a routerLink="/account" class="text-white text-xl py-2">Account</a>
|
||||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
} @else {
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12"></path>
|
<a routerLink="/login" [queryParams]="{ mode: 'login' }" class="text-white text-xl py-2">Log In</a>
|
||||||
</svg>
|
<a routerLink="/login" [queryParams]="{ mode: 'register' }" class="text-white text-xl py-2">Sign Up</a>
|
||||||
</button>
|
}
|
||||||
</div>
|
<button
|
||||||
</div>
|
(click)="toggleMenu()"
|
||||||
|
class="text-white mt-4"
|
||||||
<!-- ==== ANPASSUNGEN START ==== -->
|
aria-label="Close navigation menu"
|
||||||
<!-- 1. px-4 für <main> (vorher px-2 sm:px-4) -->
|
>
|
||||||
<main class="flex flex-col items-center justify-center px-4 w-full flex-grow">
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<div
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12"></path>
|
||||||
class="bg-cover-custom pb-12 md:py-20 flex flex-col w-full rounded-xl lg:rounded-2xl md:drop-shadow-custom-md lg:drop-shadow-custom-lg min-h-[calc(100vh_-_20rem)] lg:min-h-[calc(100vh_-_10rem)] max-sm:bg-contain max-sm:bg-bottom max-sm:bg-no-repeat max-sm:min-h-[60vh] max-sm:bg-primary-600"
|
</svg>
|
||||||
>
|
</button>
|
||||||
<div class="flex justify-center w-full">
|
</div>
|
||||||
<!-- 3. Für Mobile: m-2 statt max-w-xs; ab sm: wieder max-width und kein Margin -->
|
</div>
|
||||||
<div class="w-full m-2 sm:m-0 sm:max-w-md md:max-w-xl lg:max-w-2xl xl:max-w-3xl">
|
|
||||||
<!-- Hero-Container -->
|
<!-- ==== ANPASSUNGEN START ==== -->
|
||||||
<section class="relative">
|
<!-- 1. px-4 für <main> (vorher px-2 sm:px-4) -->
|
||||||
<!-- Dein Hintergrundbild liegt hier per CSS oder absolutem <img> -->
|
<main class="flex flex-col items-center justify-center px-4 w-full flex-grow">
|
||||||
|
<div
|
||||||
<!-- 1) Overlay: sorgt für Kontrast auf hellem Himmel -->
|
class="relative overflow-hidden pb-12 md:py-20 flex flex-col w-full rounded-xl lg:rounded-2xl md:drop-shadow-custom-md lg:drop-shadow-custom-lg min-h-[calc(100vh_-_20rem)] lg:min-h-[calc(100vh_-_10rem)] max-sm:min-h-[60vh] max-sm:bg-primary-600"
|
||||||
<div aria-hidden="true" class="pointer-events-none absolute inset-0"></div>
|
>
|
||||||
|
<!-- Optimized Background Image -->
|
||||||
<!-- 2) Textblock -->
|
<picture class="absolute inset-0 w-full h-full z-0 pointer-events-none">
|
||||||
<div class="relative z-10 mx-auto max-w-4xl px-6 sm:px-6 py-4 sm:py-16 text-center text-white">
|
<source srcset="/assets/images/flags_bg.avif" type="image/avif">
|
||||||
<h1 class="text-[1.55rem] sm:text-4xl md:text-5xl lg:text-6xl font-extrabold tracking-tight leading-tight drop-shadow-[0_2px_6px_rgba(0,0,0,0.55)]">Buy & Sell Businesses and Commercial Properties</h1>
|
<img
|
||||||
|
width="2500"
|
||||||
<p class="mt-3 sm:mt-4 text-base sm:text-lg md:text-xl lg:text-2xl font-medium text-white/90 drop-shadow-[0_1.5px_4px_rgba(0,0,0,0.6)]">
|
height="1285"
|
||||||
Find profitable businesses for sale, commercial real estate, and franchise opportunities across the United States
|
fetchpriority="high"
|
||||||
</p>
|
loading="eager"
|
||||||
</div>
|
src="/assets/images/flags_bg.jpg"
|
||||||
</section>
|
alt=""
|
||||||
<!-- Restliche Anpassungen (Innenabstände, Button-Paddings etc.) bleiben wie im vorherigen Schritt -->
|
class="w-full h-full object-cover"
|
||||||
<div class="search-form-container bg-white bg-opacity-80 pb-4 md:pb-6 pt-2 px-3 sm:px-4 md:px-6 rounded-lg shadow-lg w-full" [ngClass]="{ 'pt-6': aiSearch }">
|
>
|
||||||
@if(!aiSearch){
|
</picture>
|
||||||
<div class="text-sm lg:text-base mb-1 text-center text-neutral-500 border-neutral-200 dark:text-neutral-400 dark:border-neutral-700 flex justify-between">
|
|
||||||
<ul class="flex flex-wrap -mb-px w-full">
|
<!-- Gradient Overlay -->
|
||||||
<li class="w-[33%]">
|
<div class="absolute inset-0 bg-gradient-to-b from-black/35 via-black/15 to-transparent z-0 pointer-events-none"></div>
|
||||||
<a
|
|
||||||
(click)="changeTab('business')"
|
<div class="flex justify-center w-full relative z-10">
|
||||||
[ngClass]="
|
<!-- 3. Für Mobile: m-2 statt max-w-xs; ab sm: wieder max-width und kein Margin -->
|
||||||
activeTabAction === 'business'
|
<div class="w-full m-2 sm:m-0 sm:max-w-md md:max-w-xl lg:max-w-2xl xl:max-w-3xl">
|
||||||
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
<!-- Hero-Container -->
|
||||||
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
<section class="relative">
|
||||||
"
|
<!-- Dein Hintergrundbild liegt hier per CSS oder absolutem <img> -->
|
||||||
class="tab-link hover:cursor-pointer inline-flex items-center justify-center px-1 py-2 md:p-4 border-b-2 rounded-t-lg"
|
|
||||||
>
|
<!-- 1) Overlay: sorgt für Kontrast auf hellem Himmel (Previous overlay removed, using new global overlay) -->
|
||||||
<img src="/assets/images/business_logo.png" alt="Search businesses for sale" class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain" width="28" height="28" />
|
<!-- <div aria-hidden="true" class="pointer-events-none absolute inset-0"></div> -->
|
||||||
<span>Businesses</span>
|
|
||||||
</a>
|
<!-- 2) Textblock -->
|
||||||
</li>
|
<div class="relative z-10 mx-auto max-w-4xl px-6 sm:px-6 py-4 sm:py-16 text-center text-white">
|
||||||
@if ((numberOfCommercial$ | async) > 0) {
|
<h1 class="text-[1.55rem] sm:text-4xl md:text-5xl lg:text-6xl font-extrabold tracking-tight leading-tight drop-shadow-[0_2px_6px_rgba(0,0,0,0.55)]">Buy & Sell Businesses and Commercial Properties</h1>
|
||||||
<li class="w-[33%]">
|
|
||||||
<a
|
<p class="mt-3 sm:mt-4 text-base sm:text-lg md:text-xl lg:text-2xl font-medium text-white/90 drop-shadow-[0_1.5px_4px_rgba(0,0,0,0.6)]">
|
||||||
(click)="changeTab('commercialProperty')"
|
Buy profitable businesses for sale or sell your business to qualified buyers. Browse commercial real estate and franchise opportunities across the United States.
|
||||||
[ngClass]="
|
</p>
|
||||||
activeTabAction === 'commercialProperty'
|
</div>
|
||||||
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
</section>
|
||||||
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
<!-- Restliche Anpassungen (Innenabstände, Button-Paddings etc.) bleiben wie im vorherigen Schritt -->
|
||||||
"
|
<div class="search-form-container bg-white bg-opacity-80 pb-4 md:pb-6 pt-2 px-3 sm:px-4 md:px-6 rounded-lg shadow-lg w-full" [ngClass]="{ 'pt-6': aiSearch }">
|
||||||
class="tab-link hover:cursor-pointer inline-flex items-center justify-center px-1 py-2 md:p-4 border-b-2 rounded-t-lg"
|
@if(!aiSearch){
|
||||||
>
|
<div class="text-sm lg:text-base mb-1 text-center text-neutral-500 border-neutral-200 dark:text-neutral-400 dark:border-neutral-700 flex justify-between">
|
||||||
<img src="/assets/images/properties_logo.png" alt="Search commercial properties for sale" class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain" width="28" height="28" />
|
<ul class="flex flex-wrap -mb-px w-full" role="tablist">
|
||||||
<span>Properties</span>
|
<li class="w-[33%]" role="presentation">
|
||||||
</a>
|
<button
|
||||||
</li>
|
type="button"
|
||||||
}
|
role="tab"
|
||||||
<li class="w-[33%]">
|
[attr.aria-selected]="activeTabAction === 'business'"
|
||||||
<a
|
(click)="changeTab('business')"
|
||||||
(click)="changeTab('broker')"
|
[ngClass]="
|
||||||
[ngClass]="
|
activeTabAction === 'business'
|
||||||
activeTabAction === 'broker'
|
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
||||||
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
||||||
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
"
|
||||||
"
|
class="tab-link w-full hover:cursor-pointer inline-flex items-center justify-center px-3 py-3 md:p-4 border-b-2 rounded-t-lg bg-transparent"
|
||||||
class="tab-link hover:cursor-pointer inline-flex items-center justify-center px-1 py-2 md:p-4 border-b-2 rounded-t-lg"
|
>
|
||||||
>
|
<img src="/assets/images/business_logo.png" alt="" aria-hidden="true" class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain" width="28" height="28" />
|
||||||
<img
|
<span>Businesses</span>
|
||||||
src="/assets/images/icon_professionals.png"
|
</button>
|
||||||
alt="Search business professionals and brokers"
|
</li>
|
||||||
class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain bg-transparent"
|
@if ((numberOfCommercial$ | async) > 0) {
|
||||||
style="mix-blend-mode: darken"
|
<li class="w-[33%]" role="presentation">
|
||||||
/>
|
<button
|
||||||
<span>Professionals</span>
|
type="button"
|
||||||
</a>
|
role="tab"
|
||||||
</li>
|
[attr.aria-selected]="activeTabAction === 'commercialProperty'"
|
||||||
</ul>
|
(click)="changeTab('commercialProperty')"
|
||||||
</div>
|
[ngClass]="
|
||||||
} @if(criteria && !aiSearch){
|
activeTabAction === 'commercialProperty'
|
||||||
<div class="w-full max-w-3xl mx-auto bg-white rounded-lg flex flex-col md:flex-row md:border md:border-neutral-300">
|
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
||||||
<div class="md:flex-none md:w-48 flex-1 md:border-r border-neutral-300 overflow-hidden mb-2 md:mb-0">
|
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
||||||
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
"
|
||||||
<select
|
class="tab-link w-full hover:cursor-pointer inline-flex items-center justify-center px-3 py-3 md:p-4 border-b-2 rounded-t-lg bg-transparent"
|
||||||
class="appearance-none bg-transparent w-full py-4 px-4 pr-8 focus:outline-none md:border-none rounded-md md:rounded-none min-h-[52px]"
|
>
|
||||||
[ngModel]="criteria.types"
|
<img src="/assets/images/properties_logo.png" alt="" aria-hidden="true" class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain" width="28" height="28" />
|
||||||
(ngModelChange)="onTypesChange($event)"
|
<span>Properties</span>
|
||||||
[ngClass]="{ 'placeholder-selected': criteria.types.length === 0 }"
|
</button>
|
||||||
>
|
</li>
|
||||||
<option [value]="[]">{{ getPlaceholderLabel() }}</option>
|
}
|
||||||
@for(type of getTypes(); track type){
|
<li class="w-[33%]" role="presentation">
|
||||||
<option [value]="type.value">{{ type.name }}</option>
|
<button
|
||||||
}
|
type="button"
|
||||||
</select>
|
role="tab"
|
||||||
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-700">
|
[attr.aria-selected]="activeTabAction === 'broker'"
|
||||||
<i class="fas fa-chevron-down text-xs"></i>
|
(click)="changeTab('broker')"
|
||||||
</div>
|
[ngClass]="
|
||||||
</div>
|
activeTabAction === 'broker'
|
||||||
</div>
|
? ['text-primary-600', 'border-primary-600', 'active', 'dark:text-primary-500', 'dark:border-primary-500']
|
||||||
|
: ['border-transparent', 'hover:text-neutral-600', 'hover:border-neutral-300', 'dark:hover:text-neutral-300']
|
||||||
<div class="md:flex-auto md:w-36 flex-grow md:border-r border-neutral-300 mb-2 md:mb-0">
|
"
|
||||||
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
class="tab-link w-full hover:cursor-pointer inline-flex items-center justify-center px-3 py-3 md:p-4 border-b-2 rounded-t-lg bg-transparent"
|
||||||
<ng-select
|
>
|
||||||
class="custom md:border-none rounded-md md:rounded-none"
|
<img
|
||||||
[multiple]="false"
|
src="/assets/images/icon_professionals.png"
|
||||||
[hideSelected]="true"
|
alt=""
|
||||||
[trackByFn]="trackByFn"
|
aria-hidden="true"
|
||||||
[minTermLength]="2"
|
class="tab-icon w-6 h-6 md:w-7 md:h-7 mr-1 md:mr-2 object-contain"
|
||||||
[loading]="cityLoading"
|
style="mix-blend-mode: darken"
|
||||||
typeToSearchText="Please enter 2 or more characters"
|
width="28" height="28"
|
||||||
[typeahead]="cityInput$"
|
/>
|
||||||
[ngModel]="cityOrState"
|
<span>Professionals</span>
|
||||||
(ngModelChange)="setCityOrState($event)"
|
</button>
|
||||||
placeholder="Enter City or State ..."
|
</li>
|
||||||
groupBy="type"
|
</ul>
|
||||||
>
|
</div>
|
||||||
@for (city of cities$ | async; track city.id) { @let state = city.type==='city'?city.content.state:''; @let separator = city.type==='city'?' - ':'';
|
} @if(criteria && !aiSearch){
|
||||||
<ng-option [value]="city">{{ city.content.name }}{{ separator }}{{ state }}</ng-option>
|
<div class="w-full max-w-3xl mx-auto bg-white rounded-lg flex flex-col md:flex-row md:border md:border-neutral-300">
|
||||||
}
|
<div class="md:flex-none md:w-48 flex-1 md:border-r border-neutral-300 overflow-hidden mb-2 md:mb-0">
|
||||||
</ng-select>
|
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
||||||
</div>
|
<label for="type-filter" class="sr-only">Filter by type</label>
|
||||||
</div>
|
<select
|
||||||
@if (criteria.radius && !aiSearch){
|
id="type-filter"
|
||||||
<div class="md:flex-none md:w-36 flex-1 md:border-r border-neutral-300 mb-2 md:mb-0">
|
aria-label="Filter by type"
|
||||||
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
|
||||||
<select
|
class="appearance-none bg-transparent w-full py-4 px-4 pr-8 focus:outline-none md:border-none rounded-md md:rounded-none min-h-[52px]"
|
||||||
class="appearance-none bg-transparent w-full py-4 px-4 pr-8 focus:outline-none md:border-none rounded-md md:rounded-none min-h-[52px]"
|
[ngModel]="criteria.types"
|
||||||
(ngModelChange)="onRadiusChange($event)"
|
(ngModelChange)="onTypesChange($event)"
|
||||||
[ngModel]="criteria.radius"
|
[ngClass]="{ 'placeholder-selected': criteria.types.length === 0 }"
|
||||||
[ngClass]="{ 'placeholder-selected': !criteria.radius }"
|
>
|
||||||
>
|
<option [value]="[]">{{ getPlaceholderLabel() }}</option>
|
||||||
<option [value]="null">City Radius</option>
|
@for(type of getTypes(); track type){
|
||||||
@for(dist of selectOptions.distances; track dist){
|
<option [value]="type.value">{{ type.name }}</option>
|
||||||
<option [value]="dist.value">{{ dist.name }}</option>
|
}
|
||||||
}
|
</select>
|
||||||
</select>
|
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-700">
|
||||||
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-700">
|
<i class="fas fa-chevron-down text-xs"></i>
|
||||||
<i class="fas fa-chevron-down text-xs"></i>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
}
|
<div class="md:flex-auto md:w-36 flex-grow md:border-r border-neutral-300 mb-2 md:mb-0">
|
||||||
<div class="bg-primary-500 hover:bg-primary-600 max-sm:rounded-md search-button">
|
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
||||||
@if( numberOfResults$){
|
<label for="location-search" class="sr-only">Search by city or state</label>
|
||||||
<button class="w-full h-full text-white font-bold py-2 px-4 md:py-3 md:px-6 focus:outline-none rounded-md md:rounded-none min-h-[52px] flex items-center justify-center gap-2" (click)="search()">
|
<ng-select
|
||||||
<i class="fas fa-search"></i>
|
class="custom md:border-none rounded-md md:rounded-none"
|
||||||
<span>Search {{ numberOfResults$ | async }}</span>
|
[multiple]="false"
|
||||||
</button>
|
[hideSelected]="true"
|
||||||
}@else {
|
[trackByFn]="trackByFn"
|
||||||
<button class="w-full h-full text-white font-bold py-2 px-4 md:py-3 md:px-6 focus:outline-none rounded-md md:rounded-none min-h-[52px] flex items-center justify-center gap-2" (click)="search()">
|
[minTermLength]="2"
|
||||||
<i class="fas fa-search"></i>
|
[loading]="cityLoading"
|
||||||
<span>Search</span>
|
typeToSearchText="Please enter 2 or more characters"
|
||||||
</button>
|
[typeahead]="cityInput$"
|
||||||
}
|
[ngModel]="cityOrState"
|
||||||
</div>
|
(ngModelChange)="setCityOrState($event)"
|
||||||
</div>
|
placeholder="Enter City or State ..."
|
||||||
}
|
groupBy="type"
|
||||||
</div>
|
labelForId="location-search"
|
||||||
</div>
|
aria-label="Search by city or state"
|
||||||
</div>
|
>
|
||||||
</div>
|
@for (city of cities$ | async; track city.id) { @let state = city.type==='city'?city.content.state:''; @let separator = city.type==='city'?' - ':'';
|
||||||
|
<ng-option [value]="city">{{ city.content.name }}{{ separator }}{{ state }}</ng-option>
|
||||||
<!-- FAQ Section for SEO/AEO -->
|
}
|
||||||
<!-- <div class="w-full px-4 mt-12 max-w-4xl mx-auto">
|
</ng-select>
|
||||||
<app-faq [faqItems]="faqItems"></app-faq>
|
</div>
|
||||||
</div> -->
|
</div>
|
||||||
</main>
|
@if (criteria.radius && !aiSearch){
|
||||||
<!-- ==== ANPASSUNGEN ENDE ==== -->
|
<div class="md:flex-none md:w-36 flex-1 md:border-r border-neutral-300 mb-2 md:mb-0">
|
||||||
|
<div class="relative max-sm:border border-neutral-300 rounded-md">
|
||||||
|
<label for="radius-filter" class="sr-only">Filter by radius</label>
|
||||||
|
<select
|
||||||
|
id="radius-filter"
|
||||||
|
aria-label="Filter by radius"
|
||||||
|
class="appearance-none bg-transparent w-full py-4 px-4 pr-8 focus:outline-none md:border-none rounded-md md:rounded-none min-h-[52px]"
|
||||||
|
(ngModelChange)="onRadiusChange($event)"
|
||||||
|
[ngModel]="criteria.radius"
|
||||||
|
[ngClass]="{ 'placeholder-selected': !criteria.radius }"
|
||||||
|
>
|
||||||
|
<option [value]="null">City Radius</option>
|
||||||
|
@for(dist of selectOptions.distances; track dist){
|
||||||
|
<option [value]="dist.value">{{ dist.name }}</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-neutral-700">
|
||||||
|
<i class="fas fa-chevron-down text-xs"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div class="bg-primary-500 hover:bg-primary-600 max-sm:rounded-md search-button">
|
||||||
|
@if( numberOfResults$){
|
||||||
|
<button aria-label="Search listings" class="w-full h-full text-white font-bold py-2 px-4 md:py-3 md:px-6 focus:outline-none rounded-md md:rounded-none min-h-[52px] flex items-center justify-center gap-2" (click)="search()">
|
||||||
|
<i class="fas fa-search" aria-hidden="true"></i>
|
||||||
|
<span>Search {{ numberOfResults$ | async }}</span>
|
||||||
|
</button>
|
||||||
|
}@else {
|
||||||
|
<button aria-label="Search listings" class="w-full h-full text-white font-bold py-2 px-4 md:py-3 md:px-6 focus:outline-none rounded-md md:rounded-none min-h-[52px] flex items-center justify-center gap-2" (click)="search()">
|
||||||
|
<i class="fas fa-search" aria-hidden="true"></i>
|
||||||
|
<span>Search</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FAQ Section for SEO/AEO -->
|
||||||
|
<!-- <div class="w-full px-4 mt-12 max-w-4xl mx-auto">
|
||||||
|
<app-faq [faqItems]="faqItems"></app-faq>
|
||||||
|
</div> -->
|
||||||
|
</main>
|
||||||
|
<!-- ==== ANPASSUNGEN ENDE ==== -->
|
||||||
|
|
|
||||||
|
|
@ -1,271 +1,252 @@
|
||||||
.bg-cover-custom {
|
|
||||||
position: relative;
|
select:not([size]) {
|
||||||
// Prioritize AVIF format (69KB) over JPG (26MB)
|
background-image: unset;
|
||||||
background-image: url('/assets/images/flags_bg.avif');
|
}
|
||||||
background-size: cover;
|
[type='text'],
|
||||||
background-position: center;
|
[type='email'],
|
||||||
border-radius: 20px;
|
[type='url'],
|
||||||
|
[type='password'],
|
||||||
// Fallback for browsers that don't support AVIF
|
[type='number'],
|
||||||
@supports not (background-image: url('/assets/images/flags_bg.avif')) {
|
[type='date'],
|
||||||
background-image: url('/assets/images/flags_bg.jpg');
|
[type='datetime-local'],
|
||||||
}
|
[type='month'],
|
||||||
|
[type='search'],
|
||||||
// Add gradient overlay for better text contrast
|
[type='tel'],
|
||||||
&::before {
|
[type='time'],
|
||||||
content: '';
|
[type='week'],
|
||||||
position: absolute;
|
[multiple],
|
||||||
top: 0;
|
textarea,
|
||||||
left: 0;
|
select {
|
||||||
right: 0;
|
border: unset;
|
||||||
bottom: 0;
|
}
|
||||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 40%, rgba(0, 0, 0, 0.05) 70%, rgba(0, 0, 0, 0) 100%);
|
.toggle-checkbox:checked {
|
||||||
border-radius: 20px;
|
right: 0;
|
||||||
pointer-events: none;
|
border-color: rgb(125 211 252);
|
||||||
z-index: 1;
|
}
|
||||||
}
|
.toggle-checkbox:checked + .toggle-label {
|
||||||
|
background-color: rgb(125 211 252);
|
||||||
// Ensure content stays above overlay
|
}
|
||||||
> * {
|
:host ::ng-deep .ng-select.ng-select-single .ng-select-container {
|
||||||
position: relative;
|
min-height: 52px;
|
||||||
z-index: 2;
|
border: none;
|
||||||
}
|
background-color: transparent;
|
||||||
}
|
.ng-value-container .ng-input {
|
||||||
select:not([size]) {
|
top: 12px;
|
||||||
background-image: unset;
|
}
|
||||||
}
|
span.ng-arrow-wrapper {
|
||||||
[type='text'],
|
display: none;
|
||||||
[type='email'],
|
}
|
||||||
[type='url'],
|
}
|
||||||
[type='password'],
|
select {
|
||||||
[type='number'],
|
color: #000; /* Standard-Textfarbe für das Dropdown */
|
||||||
[type='date'],
|
// background-color: #fff; /* Hintergrundfarbe für das Dropdown */
|
||||||
[type='datetime-local'],
|
}
|
||||||
[type='month'],
|
|
||||||
[type='search'],
|
select option {
|
||||||
[type='tel'],
|
color: #000; /* Textfarbe für Dropdown-Optionen */
|
||||||
[type='time'],
|
}
|
||||||
[type='week'],
|
|
||||||
[multiple],
|
select.placeholder-selected {
|
||||||
textarea,
|
color: #999; /* Farbe für den Platzhalter */
|
||||||
select {
|
}
|
||||||
border: unset;
|
input::placeholder {
|
||||||
}
|
color: #555; /* Dunkleres Grau */
|
||||||
.toggle-checkbox:checked {
|
opacity: 1; /* Stellt sicher, dass die Deckkraft 100% ist */
|
||||||
right: 0;
|
}
|
||||||
border-color: rgb(125 211 252);
|
|
||||||
}
|
/* Stellt sicher, dass die Optionen im Dropdown immer schwarz sind */
|
||||||
.toggle-checkbox:checked + .toggle-label {
|
select:focus option,
|
||||||
background-color: rgb(125 211 252);
|
select:hover option {
|
||||||
}
|
color: #000 !important;
|
||||||
:host ::ng-deep .ng-select.ng-select-single .ng-select-container {
|
}
|
||||||
min-height: 52px;
|
input[type='text'][name='aiSearchText'] {
|
||||||
border: none;
|
padding: 14px; /* Innerer Abstand */
|
||||||
background-color: transparent;
|
font-size: 16px; /* Schriftgröße anpassen */
|
||||||
.ng-value-container .ng-input {
|
box-sizing: border-box; /* Padding und Border in die Höhe und Breite einrechnen */
|
||||||
top: 12px;
|
height: 48px;
|
||||||
}
|
}
|
||||||
span.ng-arrow-wrapper {
|
|
||||||
display: none;
|
// Enhanced Search Button Styling
|
||||||
}
|
.search-button {
|
||||||
}
|
position: relative;
|
||||||
select {
|
overflow: hidden;
|
||||||
color: #000; /* Standard-Textfarbe für das Dropdown */
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
// background-color: #fff; /* Hintergrundfarbe für das Dropdown */
|
|
||||||
}
|
&:hover {
|
||||||
|
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
|
||||||
select option {
|
filter: brightness(1.05);
|
||||||
color: #000; /* Textfarbe für Dropdown-Optionen */
|
}
|
||||||
}
|
|
||||||
|
&:active {
|
||||||
select.placeholder-selected {
|
transform: scale(0.98);
|
||||||
color: #999; /* Farbe für den Platzhalter */
|
}
|
||||||
}
|
|
||||||
input::placeholder {
|
// Ripple effect
|
||||||
color: #555; /* Dunkleres Grau */
|
&::after {
|
||||||
opacity: 1; /* Stellt sicher, dass die Deckkraft 100% ist */
|
content: '';
|
||||||
}
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
/* Stellt sicher, dass die Optionen im Dropdown immer schwarz sind */
|
left: 50%;
|
||||||
select:focus option,
|
width: 0;
|
||||||
select:hover option {
|
height: 0;
|
||||||
color: #000 !important;
|
border-radius: 50%;
|
||||||
}
|
background: rgba(255, 255, 255, 0.3);
|
||||||
input[type='text'][name='aiSearchText'] {
|
transform: translate(-50%, -50%);
|
||||||
padding: 14px; /* Innerer Abstand */
|
transition:
|
||||||
font-size: 16px; /* Schriftgröße anpassen */
|
width 0.6s,
|
||||||
box-sizing: border-box; /* Padding und Border in die Höhe und Breite einrechnen */
|
height 0.6s;
|
||||||
height: 48px;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enhanced Search Button Styling
|
&:active::after {
|
||||||
.search-button {
|
width: 300px;
|
||||||
position: relative;
|
height: 300px;
|
||||||
overflow: hidden;
|
}
|
||||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
}
|
||||||
|
|
||||||
&:hover {
|
// Tab Icon Styling
|
||||||
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
|
.tab-icon {
|
||||||
filter: brightness(1.05);
|
font-size: 1rem;
|
||||||
}
|
margin-right: 0.5rem;
|
||||||
|
transition: transform 0.2s ease;
|
||||||
&:active {
|
}
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
.tab-link {
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
// Ripple effect
|
|
||||||
&::after {
|
&:hover .tab-icon {
|
||||||
content: '';
|
transform: scale(1.15);
|
||||||
position: absolute;
|
}
|
||||||
top: 50%;
|
}
|
||||||
left: 50%;
|
|
||||||
width: 0;
|
// Input Field Hover Effects
|
||||||
height: 0;
|
select,
|
||||||
border-radius: 50%;
|
.ng-select {
|
||||||
background: rgba(255, 255, 255, 0.3);
|
transition: all 0.2s ease-in-out;
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
transition:
|
&:hover {
|
||||||
width 0.6s,
|
background-color: rgba(243, 244, 246, 0.8);
|
||||||
height 0.6s;
|
}
|
||||||
pointer-events: none;
|
|
||||||
}
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
&:active::after {
|
background-color: white;
|
||||||
width: 300px;
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
||||||
height: 300px;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Smooth tab transitions
|
||||||
// Tab Icon Styling
|
.tab-content {
|
||||||
.tab-icon {
|
animation: fadeInUp 0.3s ease-out;
|
||||||
font-size: 1rem;
|
}
|
||||||
margin-right: 0.5rem;
|
|
||||||
transition: transform 0.2s ease;
|
@keyframes fadeInUp {
|
||||||
}
|
from {
|
||||||
|
opacity: 0;
|
||||||
.tab-link {
|
transform: translateY(10px);
|
||||||
transition: all 0.2s ease-in-out;
|
}
|
||||||
|
to {
|
||||||
&:hover .tab-icon {
|
opacity: 1;
|
||||||
transform: scale(1.15);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input Field Hover Effects
|
// Trust section container - more prominent
|
||||||
select,
|
.trust-section-container {
|
||||||
.ng-select {
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
||||||
transition: all 0.2s ease-in-out;
|
transition:
|
||||||
|
box-shadow 0.3s ease,
|
||||||
&:hover {
|
transform 0.3s ease;
|
||||||
background-color: rgba(243, 244, 246, 0.8);
|
|
||||||
}
|
&:hover {
|
||||||
|
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
|
||||||
&:focus,
|
}
|
||||||
&:focus-within {
|
}
|
||||||
background-color: white;
|
|
||||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
// Trust badge animations - subtle lowkey style
|
||||||
}
|
.trust-badge {
|
||||||
}
|
transition: opacity 0.2s ease;
|
||||||
|
|
||||||
// Smooth tab transitions
|
&:hover {
|
||||||
.tab-content {
|
opacity: 0.8;
|
||||||
animation: fadeInUp 0.3s ease-out;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fadeInUp {
|
.trust-icon {
|
||||||
from {
|
transition:
|
||||||
opacity: 0;
|
background-color 0.2s ease,
|
||||||
transform: translateY(10px);
|
color 0.2s ease;
|
||||||
}
|
}
|
||||||
to {
|
|
||||||
opacity: 1;
|
.trust-badge:hover .trust-icon {
|
||||||
transform: translateY(0);
|
background-color: rgb(229, 231, 235); // gray-200
|
||||||
}
|
color: rgb(75, 85, 99); // gray-600
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trust section container - more prominent
|
// Stat counter animation - minimal
|
||||||
.trust-section-container {
|
.stat-number {
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
transition: color 0.2s ease;
|
||||||
transition:
|
|
||||||
box-shadow 0.3s ease,
|
&:hover {
|
||||||
transform 0.3s ease;
|
color: rgb(55, 65, 81); // gray-700 darker
|
||||||
|
}
|
||||||
&:hover {
|
}
|
||||||
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
|
|
||||||
}
|
// Search form container enhancement
|
||||||
}
|
.search-form-container {
|
||||||
|
transition: all 0.3s ease;
|
||||||
// Trust badge animations - subtle lowkey style
|
// KEIN backdrop-filter hier!
|
||||||
.trust-badge {
|
background-color: rgba(255, 255, 255, 0.95) !important;
|
||||||
transition: opacity 0.2s ease;
|
border: 1px solid rgba(0, 0, 0, 0.1); // Dunklerer Rand für Kontrast
|
||||||
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
||||||
&:hover {
|
|
||||||
opacity: 0.8;
|
// Falls Firefox das Element "vergisst", erzwingen wir eine Ebene
|
||||||
}
|
transform: translateZ(0);
|
||||||
}
|
opacity: 1 !important;
|
||||||
|
visibility: visible !important;
|
||||||
.trust-icon {
|
}
|
||||||
transition:
|
|
||||||
background-color 0.2s ease,
|
// Header button improvements
|
||||||
color 0.2s ease;
|
header {
|
||||||
}
|
a {
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
.trust-badge:hover .trust-icon {
|
|
||||||
background-color: rgb(229, 231, 235); // gray-200
|
&.text-blue-600.border.border-blue-600 {
|
||||||
color: rgb(75, 85, 99); // gray-600
|
// Log In button
|
||||||
}
|
&:hover {
|
||||||
|
background-color: rgba(37, 99, 235, 0.05);
|
||||||
// Stat counter animation - minimal
|
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
|
||||||
.stat-number {
|
}
|
||||||
transition: color 0.2s ease;
|
|
||||||
|
&:active {
|
||||||
&:hover {
|
transform: scale(0.98);
|
||||||
color: rgb(55, 65, 81); // gray-700 darker
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&.bg-blue-600 {
|
||||||
// Search form container enhancement
|
// Register button
|
||||||
.search-form-container {
|
&:hover {
|
||||||
transition: all 0.3s ease;
|
background-color: rgb(29, 78, 216);
|
||||||
// KEIN backdrop-filter hier!
|
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
|
||||||
background-color: rgba(255, 255, 255, 0.95) !important;
|
filter: brightness(1.05);
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1); // Dunklerer Rand für Kontrast
|
}
|
||||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
|
||||||
|
&:active {
|
||||||
// Falls Firefox das Element "vergisst", erzwingen wir eine Ebene
|
transform: scale(0.98);
|
||||||
transform: translateZ(0);
|
}
|
||||||
opacity: 1 !important;
|
}
|
||||||
visibility: visible !important;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header button improvements
|
// Screen reader only - visually hidden but accessible
|
||||||
header {
|
.sr-only {
|
||||||
a {
|
position: absolute;
|
||||||
transition: all 0.2s ease-in-out;
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
&.text-blue-600.border.border-blue-600 {
|
padding: 0;
|
||||||
// Log In button
|
margin: -1px;
|
||||||
&:hover {
|
overflow: hidden;
|
||||||
background-color: rgba(37, 99, 235, 0.05);
|
clip: rect(0, 0, 0, 0);
|
||||||
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
|
white-space: nowrap;
|
||||||
}
|
border-width: 0;
|
||||||
|
}
|
||||||
&:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.bg-blue-600 {
|
|
||||||
// Register button
|
|
||||||
&:hover {
|
|
||||||
background-color: rgb(29, 78, 216);
|
|
||||||
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
|
|
||||||
filter: brightness(1.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,345 +1,343 @@
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, ViewChild } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||||
import { NgSelectModule } from '@ng-select/ng-select';
|
import { NgSelectModule } from '@ng-select/ng-select';
|
||||||
import { UntilDestroy } from '@ngneat/until-destroy';
|
import { UntilDestroy } from '@ngneat/until-destroy';
|
||||||
import { catchError, concat, distinctUntilChanged, Observable, of, Subject, switchMap, tap } from 'rxjs';
|
import { catchError, concat, distinctUntilChanged, Observable, of, Subject, switchMap, tap } from 'rxjs';
|
||||||
import { BusinessListingCriteria, CityAndStateResult, CommercialPropertyListingCriteria, GeoResult, KeycloakUser, UserListingCriteria } from '../../../../../bizmatch-server/src/models/main.model';
|
import { BusinessListingCriteria, CityAndStateResult, CommercialPropertyListingCriteria, GeoResult, KeycloakUser, UserListingCriteria } from '../../../../../bizmatch-server/src/models/main.model';
|
||||||
import { FaqComponent, FAQItem } from '../../components/faq/faq.component';
|
import { FaqComponent, FAQItem } from '../../components/faq/faq.component';
|
||||||
import { ModalService } from '../../components/search-modal/modal.service';
|
import { ModalService } from '../../components/search-modal/modal.service';
|
||||||
import { TooltipComponent } from '../../components/tooltip/tooltip.component';
|
import { TooltipComponent } from '../../components/tooltip/tooltip.component';
|
||||||
import { AiService } from '../../services/ai.service';
|
import { AiService } from '../../services/ai.service';
|
||||||
import { AuthService } from '../../services/auth.service';
|
import { AuthService } from '../../services/auth.service';
|
||||||
import { FilterStateService } from '../../services/filter-state.service';
|
import { FilterStateService } from '../../services/filter-state.service';
|
||||||
import { GeoService } from '../../services/geo.service';
|
import { GeoService } from '../../services/geo.service';
|
||||||
import { ListingsService } from '../../services/listings.service';
|
import { ListingsService } from '../../services/listings.service';
|
||||||
import { SearchService } from '../../services/search.service';
|
import { SearchService } from '../../services/search.service';
|
||||||
import { SelectOptionsService } from '../../services/select-options.service';
|
import { SelectOptionsService } from '../../services/select-options.service';
|
||||||
import { SeoService } from '../../services/seo.service';
|
import { SeoService } from '../../services/seo.service';
|
||||||
import { UserService } from '../../services/user.service';
|
import { UserService } from '../../services/user.service';
|
||||||
import { map2User } from '../../utils/utils';
|
import { map2User } from '../../utils/utils';
|
||||||
|
|
||||||
@UntilDestroy()
|
@UntilDestroy()
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, FormsModule, RouterModule, NgSelectModule, FaqComponent],
|
imports: [CommonModule, FormsModule, RouterModule, NgSelectModule, FaqComponent],
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
styleUrl: './home.component.scss',
|
styleUrl: './home.component.scss',
|
||||||
})
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
export class HomeComponent {
|
})
|
||||||
placeholders: string[] = ['Property close to Houston less than 10M', 'Franchise business in Austin price less than 500K'];
|
export class HomeComponent {
|
||||||
activeTabAction: 'business' | 'commercialProperty' | 'broker' = 'business';
|
placeholders: string[] = ['Property close to Houston less than 10M', 'Franchise business in Austin price less than 500K'];
|
||||||
type: string;
|
activeTabAction: 'business' | 'commercialProperty' | 'broker' = 'business';
|
||||||
maxPrice: string;
|
type: string;
|
||||||
minPrice: string;
|
maxPrice: string;
|
||||||
criteria: BusinessListingCriteria | CommercialPropertyListingCriteria | UserListingCriteria;
|
minPrice: string;
|
||||||
states = [];
|
criteria: BusinessListingCriteria | CommercialPropertyListingCriteria | UserListingCriteria;
|
||||||
isMenuOpen = false;
|
states = [];
|
||||||
user: KeycloakUser;
|
isMenuOpen = false;
|
||||||
prompt: string;
|
user: KeycloakUser;
|
||||||
cities$: Observable<CityAndStateResult[]>;
|
prompt: string;
|
||||||
cityLoading = false;
|
cities$: Observable<CityAndStateResult[]>;
|
||||||
cityInput$ = new Subject<string>();
|
cityLoading = false;
|
||||||
cityOrState = undefined;
|
cityInput$ = new Subject<string>();
|
||||||
numberOfResults$: Observable<number>;
|
cityOrState = undefined;
|
||||||
numberOfBroker$: Observable<number>;
|
numberOfResults$: Observable<number>;
|
||||||
numberOfCommercial$: Observable<number>;
|
numberOfBroker$: Observable<number>;
|
||||||
aiSearch = false;
|
numberOfCommercial$: Observable<number>;
|
||||||
aiSearchText = '';
|
aiSearch = false;
|
||||||
aiSearchFailed = false;
|
aiSearchText = '';
|
||||||
loadingAi = false;
|
aiSearchFailed = false;
|
||||||
@ViewChild('aiSearchInput', { static: false }) searchInput!: ElementRef;
|
loadingAi = false;
|
||||||
typingSpeed: number = 100;
|
@ViewChild('aiSearchInput', { static: false }) searchInput!: ElementRef;
|
||||||
pauseTime: number = 2000;
|
typingSpeed: number = 100;
|
||||||
index: number = 0;
|
pauseTime: number = 2000;
|
||||||
charIndex: number = 0;
|
index: number = 0;
|
||||||
typingInterval: any;
|
charIndex: number = 0;
|
||||||
showInput: boolean = true;
|
typingInterval: any;
|
||||||
tooltipTargetBeta = 'tooltipTargetBeta';
|
showInput: boolean = true;
|
||||||
|
tooltipTargetBeta = 'tooltipTargetBeta';
|
||||||
// FAQ data optimized for AEO (Answer Engine Optimization) and Featured Snippets
|
|
||||||
faqItems: FAQItem[] = [
|
// FAQ data optimized for AEO (Answer Engine Optimization) and Featured Snippets
|
||||||
{
|
faqItems: FAQItem[] = [
|
||||||
question: 'How do I buy a business on BizMatch?',
|
{
|
||||||
answer: '<p><strong>Buying a business on BizMatch involves 6 simple steps:</strong></p><ol><li><strong>Browse Listings:</strong> Search our marketplace using filters for industry, location, and price range</li><li><strong>Review Details:</strong> Examine financial information, business operations, and growth potential</li><li><strong>Contact Seller:</strong> Reach out directly through our secure messaging platform</li><li><strong>Due Diligence:</strong> Review financial statements, contracts, and legal documents</li><li><strong>Negotiate Terms:</strong> Work with the seller to agree on price and transition details</li><li><strong>Close Deal:</strong> Complete the purchase with legal and financial advisors</li></ol><p>We recommend working with experienced business brokers and conducting thorough due diligence before making any purchase.</p>'
|
question: 'How do I buy a business on BizMatch?',
|
||||||
},
|
answer: '<p><strong>Buying a business on BizMatch involves 6 simple steps:</strong></p><ol><li><strong>Browse Listings:</strong> Search our marketplace using filters for industry, location, and price range</li><li><strong>Review Details:</strong> Examine financial information, business operations, and growth potential</li><li><strong>Contact Seller:</strong> Reach out directly through our secure messaging platform</li><li><strong>Due Diligence:</strong> Review financial statements, contracts, and legal documents</li><li><strong>Negotiate Terms:</strong> Work with the seller to agree on price and transition details</li><li><strong>Close Deal:</strong> Complete the purchase with legal and financial advisors</li></ol><p>We recommend working with experienced business brokers and conducting thorough due diligence before making any purchase.</p>'
|
||||||
{
|
},
|
||||||
question: 'How much does it cost to list a business for sale?',
|
{
|
||||||
answer: '<p><strong>BizMatch offers flexible pricing options:</strong></p><ul><li><strong>Free Basic Listing:</strong> Post your business with essential details at no cost</li><li><strong>Premium Listing:</strong> Enhanced visibility with featured placement and priority support</li><li><strong>Broker Packages:</strong> Professional tools for business brokers and agencies</li></ul><p>Contact our team for detailed pricing information tailored to your specific needs.</p>'
|
question: 'How much does it cost to list a business for sale?',
|
||||||
},
|
answer: '<p><strong>BizMatch offers flexible pricing options:</strong></p><ul><li><strong>Free Basic Listing:</strong> Post your business with essential details at no cost</li><li><strong>Premium Listing:</strong> Enhanced visibility with featured placement and priority support</li><li><strong>Broker Packages:</strong> Professional tools for business brokers and agencies</li></ul><p>Contact our team for detailed pricing information tailored to your specific needs.</p>'
|
||||||
{
|
},
|
||||||
question: 'What types of businesses can I find on BizMatch?',
|
{
|
||||||
answer: '<p><strong>BizMatch features businesses across all major industries:</strong></p><ul><li><strong>Food & Hospitality:</strong> Restaurants, cafes, bars, hotels, catering services</li><li><strong>Retail:</strong> Stores, boutiques, online shops, franchises</li><li><strong>Service Businesses:</strong> Consulting firms, cleaning services, healthcare practices</li><li><strong>Manufacturing:</strong> Production facilities, distribution centers, warehouses</li><li><strong>E-commerce:</strong> Online businesses, digital products, subscription services</li><li><strong>Commercial Real Estate:</strong> Office buildings, retail spaces, industrial properties</li></ul><p>Our marketplace serves all business sizes from small local operations to large enterprises across the United States.</p>'
|
question: 'What types of businesses can I find on BizMatch?',
|
||||||
},
|
answer: '<p><strong>BizMatch features businesses across all major industries:</strong></p><ul><li><strong>Food & Hospitality:</strong> Restaurants, cafes, bars, hotels, catering services</li><li><strong>Retail:</strong> Stores, boutiques, online shops, franchises</li><li><strong>Service Businesses:</strong> Consulting firms, cleaning services, healthcare practices</li><li><strong>Manufacturing:</strong> Production facilities, distribution centers, warehouses</li><li><strong>E-commerce:</strong> Online businesses, digital products, subscription services</li><li><strong>Commercial Real Estate:</strong> Office buildings, retail spaces, industrial properties</li></ul><p>Our marketplace serves all business sizes from small local operations to large enterprises across the United States.</p>'
|
||||||
{
|
},
|
||||||
question: 'How do I know if a business listing is legitimate?',
|
{
|
||||||
answer: '<p><strong>Yes, BizMatch verifies all listings.</strong> Here\'s how we ensure legitimacy:</p><ol><li><strong>Seller Verification:</strong> All users must verify their identity and contact information</li><li><strong>Listing Review:</strong> Our team reviews each listing for completeness and accuracy</li><li><strong>Documentation Check:</strong> We verify business registration and ownership documents</li><li><strong>Transparent Communication:</strong> All conversations are logged through our secure platform</li></ol><p><strong>Additional steps you should take:</strong></p><ul><li>Review financial statements and tax returns</li><li>Visit the business location in person</li><li>Consult with legal and financial advisors</li><li>Work with licensed business brokers when appropriate</li><li>Conduct background checks on sellers</li></ul>'
|
question: 'How do I know if a business listing is legitimate?',
|
||||||
},
|
answer: '<p><strong>Yes, BizMatch verifies all listings.</strong> Here\'s how we ensure legitimacy:</p><ol><li><strong>Seller Verification:</strong> All users must verify their identity and contact information</li><li><strong>Listing Review:</strong> Our team reviews each listing for completeness and accuracy</li><li><strong>Documentation Check:</strong> We verify business registration and ownership documents</li><li><strong>Transparent Communication:</strong> All conversations are logged through our secure platform</li></ol><p><strong>Additional steps you should take:</strong></p><ul><li>Review financial statements and tax returns</li><li>Visit the business location in person</li><li>Consult with legal and financial advisors</li><li>Work with licensed business brokers when appropriate</li><li>Conduct background checks on sellers</li></ul>'
|
||||||
{
|
},
|
||||||
question: 'Can I sell commercial property on BizMatch?',
|
{
|
||||||
answer: '<p><strong>Yes!</strong> BizMatch is a full-service marketplace for both businesses and commercial real estate.</p><p><strong>Property types you can list:</strong></p><ul><li>Office buildings and professional spaces</li><li>Retail locations and shopping centers</li><li>Warehouses and distribution facilities</li><li>Industrial properties and manufacturing plants</li><li>Mixed-use developments</li><li>Land for commercial development</li></ul><p>Our platform connects you with qualified buyers, investors, and commercial real estate professionals actively searching for investment opportunities.</p>'
|
question: 'Can I sell commercial property on BizMatch?',
|
||||||
},
|
answer: '<p><strong>Yes!</strong> BizMatch is a full-service marketplace for both businesses and commercial real estate.</p><p><strong>Property types you can list:</strong></p><ul><li>Office buildings and professional spaces</li><li>Retail locations and shopping centers</li><li>Warehouses and distribution facilities</li><li>Industrial properties and manufacturing plants</li><li>Mixed-use developments</li><li>Land for commercial development</li></ul><p>Our platform connects you with qualified buyers, investors, and commercial real estate professionals actively searching for investment opportunities.</p>'
|
||||||
{
|
},
|
||||||
question: 'What information should I include when listing my business?',
|
{
|
||||||
answer: '<p><strong>A complete listing should include these essential details:</strong></p><ol><li><strong>Financial Information:</strong> Asking price, annual revenue, cash flow, profit margins</li><li><strong>Business Operations:</strong> Years established, number of employees, hours of operation</li><li><strong>Description:</strong> Detailed overview of products/services, customer base, competitive advantages</li><li><strong>Industry Category:</strong> Specific business type and market segment</li><li><strong>Location Details:</strong> City, state, demographic information</li><li><strong>Assets Included:</strong> Equipment, inventory, real estate, intellectual property</li><li><strong>Visual Content:</strong> High-quality photos of business premises and operations</li><li><strong>Growth Potential:</strong> Expansion opportunities and market trends</li></ol><p><strong>Pro tip:</strong> The more detailed and transparent your listing, the more interest it will generate from serious, qualified buyers.</p>'
|
question: 'What information should I include when listing my business?',
|
||||||
},
|
answer: '<p><strong>A complete listing should include these essential details:</strong></p><ol><li><strong>Financial Information:</strong> Asking price, annual revenue, cash flow, profit margins</li><li><strong>Business Operations:</strong> Years established, number of employees, hours of operation</li><li><strong>Description:</strong> Detailed overview of products/services, customer base, competitive advantages</li><li><strong>Industry Category:</strong> Specific business type and market segment</li><li><strong>Location Details:</strong> City, state, demographic information</li><li><strong>Assets Included:</strong> Equipment, inventory, real estate, intellectual property</li><li><strong>Visual Content:</strong> High-quality photos of business premises and operations</li><li><strong>Growth Potential:</strong> Expansion opportunities and market trends</li></ol><p><strong>Pro tip:</strong> The more detailed and transparent your listing, the more interest it will generate from serious, qualified buyers.</p>'
|
||||||
{
|
},
|
||||||
question: 'How long does it take to sell a business?',
|
{
|
||||||
answer: '<p><strong>Most businesses sell within 6 to 12 months.</strong> The timeline varies based on several factors:</p><p><strong>Factors that speed up sales:</strong></p><ul><li>Realistic pricing based on professional valuation</li><li>Complete and organized financial documentation</li><li>Strong business performance and growth trends</li><li>Attractive location and market conditions</li><li>Experienced business broker representation</li><li>Flexible seller terms and financing options</li></ul><p><strong>Timeline breakdown:</strong></p><ol><li><strong>Months 1-2:</strong> Preparation and listing creation</li><li><strong>Months 3-6:</strong> Marketing and buyer qualification</li><li><strong>Months 7-10:</strong> Negotiations and due diligence</li><li><strong>Months 11-12:</strong> Closing and transition</li></ol>'
|
question: 'How long does it take to sell a business?',
|
||||||
},
|
answer: '<p><strong>Most businesses sell within 6 to 12 months.</strong> The timeline varies based on several factors:</p><p><strong>Factors that speed up sales:</strong></p><ul><li>Realistic pricing based on professional valuation</li><li>Complete and organized financial documentation</li><li>Strong business performance and growth trends</li><li>Attractive location and market conditions</li><li>Experienced business broker representation</li><li>Flexible seller terms and financing options</li></ul><p><strong>Timeline breakdown:</strong></p><ol><li><strong>Months 1-2:</strong> Preparation and listing creation</li><li><strong>Months 3-6:</strong> Marketing and buyer qualification</li><li><strong>Months 7-10:</strong> Negotiations and due diligence</li><li><strong>Months 11-12:</strong> Closing and transition</li></ol>'
|
||||||
{
|
},
|
||||||
question: 'What is business valuation and why is it important?',
|
{
|
||||||
answer: '<p><strong>Business valuation is the process of determining the economic worth of a company.</strong> It calculates the fair market value based on financial performance, assets, and market conditions.</p><p><strong>Why valuation matters:</strong></p><ul><li><strong>Realistic Pricing:</strong> Attracts serious buyers and prevents extended time on market</li><li><strong>Negotiation Power:</strong> Provides data-driven justification for asking price</li><li><strong>Buyer Confidence:</strong> Professional valuations increase trust and credibility</li><li><strong>Financing Approval:</strong> Banks require valuations for business acquisition loans</li></ul><p><strong>Valuation methods include:</strong></p><ol><li><strong>Asset-Based:</strong> Total value of business assets minus liabilities</li><li><strong>Income-Based:</strong> Projected future earnings and cash flow</li><li><strong>Market-Based:</strong> Comparison to similar business sales</li><li><strong>Multiple of Earnings:</strong> Revenue or profit multiplied by industry-standard factor</li></ol>'
|
question: 'What is business valuation and why is it important?',
|
||||||
},
|
answer: '<p><strong>Business valuation is the process of determining the economic worth of a company.</strong> It calculates the fair market value based on financial performance, assets, and market conditions.</p><p><strong>Why valuation matters:</strong></p><ul><li><strong>Realistic Pricing:</strong> Attracts serious buyers and prevents extended time on market</li><li><strong>Negotiation Power:</strong> Provides data-driven justification for asking price</li><li><strong>Buyer Confidence:</strong> Professional valuations increase trust and credibility</li><li><strong>Financing Approval:</strong> Banks require valuations for business acquisition loans</li></ul><p><strong>Valuation methods include:</strong></p><ol><li><strong>Asset-Based:</strong> Total value of business assets minus liabilities</li><li><strong>Income-Based:</strong> Projected future earnings and cash flow</li><li><strong>Market-Based:</strong> Comparison to similar business sales</li><li><strong>Multiple of Earnings:</strong> Revenue or profit multiplied by industry-standard factor</li></ol>'
|
||||||
{
|
},
|
||||||
question: 'Do I need a business broker to buy or sell a business?',
|
{
|
||||||
answer: '<p><strong>No, but brokers are highly recommended.</strong> You can conduct transactions directly through BizMatch, but professional brokers provide significant advantages:</p><p><strong>Benefits of using a business broker:</strong></p><ul><li><strong>Expert Valuation:</strong> Accurate pricing based on market data and analysis</li><li><strong>Marketing Expertise:</strong> Professional listing creation and buyer outreach</li><li><strong>Qualified Buyers:</strong> Pre-screening to ensure financial capability and serious interest</li><li><strong>Negotiation Skills:</strong> Experience handling complex deal structures and terms</li><li><strong>Confidentiality:</strong> Protect sensitive information during the sales process</li><li><strong>Legal Compliance:</strong> Navigate regulations, contracts, and disclosures</li><li><strong>Time Savings:</strong> Handle paperwork, communications, and coordination</li></ul><p>BizMatch connects you with licensed brokers in your area, or you can manage the transaction yourself using our secure platform and resources.</p>'
|
question: 'Do I need a business broker to buy or sell a business?',
|
||||||
},
|
answer: '<p><strong>No, but brokers are highly recommended.</strong> You can conduct transactions directly through BizMatch, but professional brokers provide significant advantages:</p><p><strong>Benefits of using a business broker:</strong></p><ul><li><strong>Expert Valuation:</strong> Accurate pricing based on market data and analysis</li><li><strong>Marketing Expertise:</strong> Professional listing creation and buyer outreach</li><li><strong>Qualified Buyers:</strong> Pre-screening to ensure financial capability and serious interest</li><li><strong>Negotiation Skills:</strong> Experience handling complex deal structures and terms</li><li><strong>Confidentiality:</strong> Protect sensitive information during the sales process</li><li><strong>Legal Compliance:</strong> Navigate regulations, contracts, and disclosures</li><li><strong>Time Savings:</strong> Handle paperwork, communications, and coordination</li></ul><p>BizMatch connects you with licensed brokers in your area, or you can manage the transaction yourself using our secure platform and resources.</p>'
|
||||||
{
|
},
|
||||||
question: 'What financing options are available for buying a business?',
|
{
|
||||||
answer: '<p><strong>Business buyers have multiple financing options:</strong></p><ol><li><strong>SBA 7(a) Loans:</strong> Government-backed loans with favorable terms<ul><li>Down payment as low as 10%</li><li>Loan amounts up to $5 million</li><li>Competitive interest rates</li><li>Terms up to 10-25 years</li></ul></li><li><strong>Conventional Bank Financing:</strong> Traditional business acquisition loans<ul><li>Typically require 20-30% down payment</li><li>Based on creditworthiness and business performance</li></ul></li><li><strong>Seller Financing:</strong> Owner provides loan to buyer<ul><li>More flexible terms and requirements</li><li>Often combined with other financing</li><li>Typically 10-30% of purchase price</li></ul></li><li><strong>Investor Partnerships:</strong> Equity financing from partners<ul><li>Shared ownership and profits</li><li>No personal debt obligation</li></ul></li><li><strong>Personal Savings:</strong> Self-funded purchase<ul><li>No interest or loan payments</li><li>Full ownership from day one</li></ul></li></ol><p><strong>Most buyers use a combination of these options</strong> to structure the optimal deal for their situation.</p>'
|
question: 'What financing options are available for buying a business?',
|
||||||
}
|
answer: '<p><strong>Business buyers have multiple financing options:</strong></p><ol><li><strong>SBA 7(a) Loans:</strong> Government-backed loans with favorable terms<ul><li>Down payment as low as 10%</li><li>Loan amounts up to $5 million</li><li>Competitive interest rates</li><li>Terms up to 10-25 years</li></ul></li><li><strong>Conventional Bank Financing:</strong> Traditional business acquisition loans<ul><li>Typically require 20-30% down payment</li><li>Based on creditworthiness and business performance</li></ul></li><li><strong>Seller Financing:</strong> Owner provides loan to buyer<ul><li>More flexible terms and requirements</li><li>Often combined with other financing</li><li>Typically 10-30% of purchase price</li></ul></li><li><strong>Investor Partnerships:</strong> Equity financing from partners<ul><li>Shared ownership and profits</li><li>No personal debt obligation</li></ul></li><li><strong>Personal Savings:</strong> Self-funded purchase<ul><li>No interest or loan payments</li><li>Full ownership from day one</li></ul></li></ol><p><strong>Most buyers use a combination of these options</strong> to structure the optimal deal for their situation.</p>'
|
||||||
];
|
}
|
||||||
|
];
|
||||||
constructor(
|
|
||||||
private router: Router,
|
constructor(
|
||||||
private modalService: ModalService,
|
private router: Router,
|
||||||
private searchService: SearchService,
|
private modalService: ModalService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private searchService: SearchService,
|
||||||
public selectOptions: SelectOptionsService,
|
private activatedRoute: ActivatedRoute,
|
||||||
private geoService: GeoService,
|
public selectOptions: SelectOptionsService,
|
||||||
public cdRef: ChangeDetectorRef,
|
private geoService: GeoService,
|
||||||
private listingService: ListingsService,
|
public cdRef: ChangeDetectorRef,
|
||||||
private userService: UserService,
|
private listingService: ListingsService,
|
||||||
private aiService: AiService,
|
private userService: UserService,
|
||||||
private authService: AuthService,
|
private aiService: AiService,
|
||||||
private filterStateService: FilterStateService,
|
private authService: AuthService,
|
||||||
private seoService: SeoService,
|
private filterStateService: FilterStateService,
|
||||||
) { }
|
private seoService: SeoService,
|
||||||
|
) { }
|
||||||
async ngOnInit() {
|
|
||||||
// Flowbite is now initialized once in AppComponent
|
async ngOnInit() {
|
||||||
|
// Flowbite is now initialized once in AppComponent
|
||||||
// Set SEO meta tags for home page
|
|
||||||
this.seoService.updateMetaTags({
|
// Set SEO meta tags for home page
|
||||||
title: 'BizMatch - Buy & Sell Businesses and Commercial Properties',
|
this.seoService.updateMetaTags({
|
||||||
description: 'Find profitable businesses for sale, commercial real estate, and franchise opportunities across the United States. Browse thousands of listings from verified sellers and brokers.',
|
title: 'BizMatch - Buy & Sell Businesses and Commercial Properties',
|
||||||
keywords: 'business for sale, businesses for sale, buy business, sell business, commercial property, commercial real estate, franchise opportunities, business broker, business marketplace',
|
description: 'Find profitable businesses for sale, commercial real estate, and franchise opportunities. Browse thousands of verified listings across the US.',
|
||||||
type: 'website'
|
keywords: 'business for sale, businesses for sale, buy business, sell business, commercial property, commercial real estate, franchise opportunities, business broker, business marketplace',
|
||||||
});
|
type: 'website'
|
||||||
|
});
|
||||||
// Add Organization schema for brand identity and FAQ schema for AEO
|
|
||||||
const organizationSchema = this.seoService.generateOrganizationSchema();
|
// Add Organization schema for brand identity
|
||||||
const faqSchema = this.seoService.generateFAQPageSchema(
|
// NOTE: FAQ schema removed because FAQ section is hidden (violates Google's visible content requirement)
|
||||||
this.faqItems.map(item => ({
|
// FAQ content is preserved in component for future use when FAQ section is made visible
|
||||||
question: item.question,
|
const organizationSchema = this.seoService.generateOrganizationSchema();
|
||||||
answer: item.answer
|
|
||||||
}))
|
// Add HowTo schema for buying a business
|
||||||
);
|
const howToSchema = this.seoService.generateHowToSchema({
|
||||||
|
name: 'How to Buy a Business on BizMatch',
|
||||||
// Add HowTo schema for buying a business
|
description: 'Step-by-step guide to finding and purchasing your ideal business through BizMatch marketplace',
|
||||||
const howToSchema = this.seoService.generateHowToSchema({
|
totalTime: 'PT45M',
|
||||||
name: 'How to Buy a Business on BizMatch',
|
steps: [
|
||||||
description: 'Step-by-step guide to finding and purchasing your ideal business through BizMatch marketplace',
|
{
|
||||||
totalTime: 'PT45M',
|
name: 'Browse Business Listings',
|
||||||
steps: [
|
text: 'Search through thousands of verified business listings using our advanced filters. Filter by industry, location, price range, revenue, and more to find businesses that match your criteria.'
|
||||||
{
|
},
|
||||||
name: 'Browse Business Listings',
|
{
|
||||||
text: 'Search through thousands of verified business listings using our advanced filters. Filter by industry, location, price range, revenue, and more to find businesses that match your criteria.'
|
name: 'Review Business Details',
|
||||||
},
|
text: 'Examine the business financials, including annual revenue, cash flow, asking price, and years established. Read the detailed business description and view photos of the operation.'
|
||||||
{
|
},
|
||||||
name: 'Review Business Details',
|
{
|
||||||
text: 'Examine the business financials, including annual revenue, cash flow, asking price, and years established. Read the detailed business description and view photos of the operation.'
|
name: 'Contact the Seller',
|
||||||
},
|
text: 'Use our secure messaging system to contact the seller or business broker directly. Request additional information, financial documents, or schedule a site visit to see the business in person.'
|
||||||
{
|
},
|
||||||
name: 'Contact the Seller',
|
{
|
||||||
text: 'Use our secure messaging system to contact the seller or business broker directly. Request additional information, financial documents, or schedule a site visit to see the business in person.'
|
name: 'Conduct Due Diligence',
|
||||||
},
|
text: 'Review all financial statements, tax returns, lease agreements, and legal documents. Verify the business information, inspect the physical location, and consult with legal and financial advisors.'
|
||||||
{
|
},
|
||||||
name: 'Conduct Due Diligence',
|
{
|
||||||
text: 'Review all financial statements, tax returns, lease agreements, and legal documents. Verify the business information, inspect the physical location, and consult with legal and financial advisors.'
|
name: 'Make an Offer',
|
||||||
},
|
text: 'Submit a formal offer based on your valuation and due diligence findings. Negotiate terms including purchase price, payment structure, transition period, and any contingencies.'
|
||||||
{
|
},
|
||||||
name: 'Make an Offer',
|
{
|
||||||
text: 'Submit a formal offer based on your valuation and due diligence findings. Negotiate terms including purchase price, payment structure, transition period, and any contingencies.'
|
name: 'Close the Transaction',
|
||||||
},
|
text: 'Work with attorneys and escrow services to finalize all legal documents, transfer ownership, and complete the purchase. The seller will transfer assets, train you on operations, and help with the transition.'
|
||||||
{
|
}
|
||||||
name: 'Close the Transaction',
|
]
|
||||||
text: 'Work with attorneys and escrow services to finalize all legal documents, transfer ownership, and complete the purchase. The seller will transfer assets, train you on operations, and help with the transition.'
|
});
|
||||||
}
|
|
||||||
]
|
// Add SearchBox schema for Sitelinks Search
|
||||||
});
|
const searchBoxSchema = this.seoService.generateSearchBoxSchema();
|
||||||
|
|
||||||
// Add SearchBox schema for Sitelinks Search
|
// Inject schemas (FAQ schema excluded - content not visible to users)
|
||||||
const searchBoxSchema = this.seoService.generateSearchBoxSchema();
|
this.seoService.injectMultipleSchemas([organizationSchema, howToSchema, searchBoxSchema]);
|
||||||
|
|
||||||
this.seoService.injectMultipleSchemas([organizationSchema, faqSchema, howToSchema, searchBoxSchema]);
|
// Clear all filters and sort options on initial load
|
||||||
|
this.filterStateService.resetCriteria('businessListings');
|
||||||
// Clear all filters and sort options on initial load
|
this.filterStateService.resetCriteria('commercialPropertyListings');
|
||||||
this.filterStateService.resetCriteria('businessListings');
|
this.filterStateService.resetCriteria('brokerListings');
|
||||||
this.filterStateService.resetCriteria('commercialPropertyListings');
|
this.filterStateService.updateSortBy('businessListings', null);
|
||||||
this.filterStateService.resetCriteria('brokerListings');
|
this.filterStateService.updateSortBy('commercialPropertyListings', null);
|
||||||
this.filterStateService.updateSortBy('businessListings', null);
|
this.filterStateService.updateSortBy('brokerListings', null);
|
||||||
this.filterStateService.updateSortBy('commercialPropertyListings', null);
|
|
||||||
this.filterStateService.updateSortBy('brokerListings', null);
|
// Initialize criteria for the default tab
|
||||||
|
this.criteria = this.filterStateService.getCriteria('businessListings');
|
||||||
// Initialize criteria for the default tab
|
|
||||||
this.criteria = this.filterStateService.getCriteria('businessListings');
|
this.numberOfBroker$ = this.userService.getNumberOfBroker(this.filterStateService.getCriteria('brokerListings') as UserListingCriteria);
|
||||||
|
this.numberOfCommercial$ = this.listingService.getNumberOfListings('commercialProperty');
|
||||||
this.numberOfBroker$ = this.userService.getNumberOfBroker(this.filterStateService.getCriteria('brokerListings') as UserListingCriteria);
|
const token = await this.authService.getToken();
|
||||||
this.numberOfCommercial$ = this.listingService.getNumberOfListings('commercialProperty');
|
this.user = map2User(token);
|
||||||
const token = await this.authService.getToken();
|
this.loadCities();
|
||||||
this.user = map2User(token);
|
this.setTotalNumberOfResults();
|
||||||
this.loadCities();
|
}
|
||||||
this.setTotalNumberOfResults();
|
|
||||||
}
|
changeTab(tabname: 'business' | 'commercialProperty' | 'broker') {
|
||||||
|
this.activeTabAction = tabname;
|
||||||
changeTab(tabname: 'business' | 'commercialProperty' | 'broker') {
|
this.cityOrState = null;
|
||||||
this.activeTabAction = tabname;
|
const tabToListingType = {
|
||||||
this.cityOrState = null;
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
this.criteria = this.filterStateService.getCriteria(tabToListingType[tabname] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings');
|
||||||
};
|
this.setTotalNumberOfResults();
|
||||||
this.criteria = this.filterStateService.getCriteria(tabToListingType[tabname] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings');
|
}
|
||||||
this.setTotalNumberOfResults();
|
|
||||||
}
|
search() {
|
||||||
|
this.router.navigate([`${this.activeTabAction}Listings`]);
|
||||||
search() {
|
}
|
||||||
this.router.navigate([`${this.activeTabAction}Listings`]);
|
|
||||||
}
|
toggleMenu() {
|
||||||
|
this.isMenuOpen = !this.isMenuOpen;
|
||||||
toggleMenu() {
|
}
|
||||||
this.isMenuOpen = !this.isMenuOpen;
|
|
||||||
}
|
onTypesChange(value) {
|
||||||
|
const tabToListingType = {
|
||||||
onTypesChange(value) {
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
||||||
};
|
this.filterStateService.updateCriteria(listingType, { types: value === '' ? [] : [value] });
|
||||||
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
this.criteria = this.filterStateService.getCriteria(listingType);
|
||||||
this.filterStateService.updateCriteria(listingType, { types: value === '' ? [] : [value] });
|
this.setTotalNumberOfResults();
|
||||||
this.criteria = this.filterStateService.getCriteria(listingType);
|
}
|
||||||
this.setTotalNumberOfResults();
|
|
||||||
}
|
onRadiusChange(value) {
|
||||||
|
const tabToListingType = {
|
||||||
onRadiusChange(value) {
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
||||||
};
|
this.filterStateService.updateCriteria(listingType, { radius: value === 'null' ? null : parseInt(value) });
|
||||||
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
this.criteria = this.filterStateService.getCriteria(listingType);
|
||||||
this.filterStateService.updateCriteria(listingType, { radius: value === 'null' ? null : parseInt(value) });
|
this.setTotalNumberOfResults();
|
||||||
this.criteria = this.filterStateService.getCriteria(listingType);
|
}
|
||||||
this.setTotalNumberOfResults();
|
|
||||||
}
|
async openModal() {
|
||||||
|
const tabToListingType = {
|
||||||
async openModal() {
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
||||||
};
|
const accepted = await this.modalService.showModal(this.criteria);
|
||||||
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
if (accepted) {
|
||||||
const accepted = await this.modalService.showModal(this.criteria);
|
this.router.navigate([`${this.activeTabAction}Listings`]);
|
||||||
if (accepted) {
|
}
|
||||||
this.router.navigate([`${this.activeTabAction}Listings`]);
|
}
|
||||||
}
|
|
||||||
}
|
private loadCities() {
|
||||||
|
this.cities$ = concat(
|
||||||
private loadCities() {
|
of([]),
|
||||||
this.cities$ = concat(
|
this.cityInput$.pipe(
|
||||||
of([]),
|
distinctUntilChanged(),
|
||||||
this.cityInput$.pipe(
|
tap(() => (this.cityLoading = true)),
|
||||||
distinctUntilChanged(),
|
switchMap(term =>
|
||||||
tap(() => (this.cityLoading = true)),
|
this.geoService.findCitiesAndStatesStartingWith(term).pipe(
|
||||||
switchMap(term =>
|
catchError(() => of([])),
|
||||||
this.geoService.findCitiesAndStatesStartingWith(term).pipe(
|
tap(() => (this.cityLoading = false)),
|
||||||
catchError(() => of([])),
|
),
|
||||||
tap(() => (this.cityLoading = false)),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
),
|
}
|
||||||
);
|
|
||||||
}
|
trackByFn(item: GeoResult) {
|
||||||
|
return item.id;
|
||||||
trackByFn(item: GeoResult) {
|
}
|
||||||
return item.id;
|
|
||||||
}
|
setCityOrState(cityOrState: CityAndStateResult) {
|
||||||
|
const tabToListingType = {
|
||||||
setCityOrState(cityOrState: CityAndStateResult) {
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
||||||
};
|
|
||||||
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
if (cityOrState) {
|
||||||
|
if (cityOrState.type === 'state') {
|
||||||
if (cityOrState) {
|
this.filterStateService.updateCriteria(listingType, { state: cityOrState.content.state_code, city: null, radius: null, searchType: 'exact' });
|
||||||
if (cityOrState.type === 'state') {
|
} else {
|
||||||
this.filterStateService.updateCriteria(listingType, { state: cityOrState.content.state_code, city: null, radius: null, searchType: 'exact' });
|
this.filterStateService.updateCriteria(listingType, {
|
||||||
} else {
|
city: cityOrState.content as GeoResult,
|
||||||
this.filterStateService.updateCriteria(listingType, {
|
state: cityOrState.content.state,
|
||||||
city: cityOrState.content as GeoResult,
|
searchType: 'radius',
|
||||||
state: cityOrState.content.state,
|
radius: 20,
|
||||||
searchType: 'radius',
|
});
|
||||||
radius: 20,
|
}
|
||||||
});
|
} else {
|
||||||
}
|
this.filterStateService.updateCriteria(listingType, { state: null, city: null, radius: null, searchType: 'exact' });
|
||||||
} else {
|
}
|
||||||
this.filterStateService.updateCriteria(listingType, { state: null, city: null, radius: null, searchType: 'exact' });
|
this.criteria = this.filterStateService.getCriteria(listingType);
|
||||||
}
|
this.setTotalNumberOfResults();
|
||||||
this.criteria = this.filterStateService.getCriteria(listingType);
|
}
|
||||||
this.setTotalNumberOfResults();
|
|
||||||
}
|
getTypes() {
|
||||||
|
if (this.criteria.criteriaType === 'businessListings') {
|
||||||
getTypes() {
|
return this.selectOptions.typesOfBusiness;
|
||||||
if (this.criteria.criteriaType === 'businessListings') {
|
} else if (this.criteria.criteriaType === 'commercialPropertyListings') {
|
||||||
return this.selectOptions.typesOfBusiness;
|
return this.selectOptions.typesOfCommercialProperty;
|
||||||
} else if (this.criteria.criteriaType === 'commercialPropertyListings') {
|
} else {
|
||||||
return this.selectOptions.typesOfCommercialProperty;
|
return this.selectOptions.customerSubTypes;
|
||||||
} else {
|
}
|
||||||
return this.selectOptions.customerSubTypes;
|
}
|
||||||
}
|
|
||||||
}
|
getPlaceholderLabel() {
|
||||||
|
if (this.criteria.criteriaType === 'businessListings') {
|
||||||
getPlaceholderLabel() {
|
return 'Business Type';
|
||||||
if (this.criteria.criteriaType === 'businessListings') {
|
} else if (this.criteria.criteriaType === 'commercialPropertyListings') {
|
||||||
return 'Business Type';
|
return 'Property Type';
|
||||||
} else if (this.criteria.criteriaType === 'commercialPropertyListings') {
|
} else {
|
||||||
return 'Property Type';
|
return 'Professional Type';
|
||||||
} else {
|
}
|
||||||
return 'Professional Type';
|
}
|
||||||
}
|
|
||||||
}
|
setTotalNumberOfResults() {
|
||||||
|
if (this.criteria) {
|
||||||
setTotalNumberOfResults() {
|
console.log(`Getting total number of results for ${this.criteria.criteriaType}`);
|
||||||
if (this.criteria) {
|
const tabToListingType = {
|
||||||
console.log(`Getting total number of results for ${this.criteria.criteriaType}`);
|
business: 'businessListings',
|
||||||
const tabToListingType = {
|
commercialProperty: 'commercialPropertyListings',
|
||||||
business: 'businessListings',
|
broker: 'brokerListings',
|
||||||
commercialProperty: 'commercialPropertyListings',
|
};
|
||||||
broker: 'brokerListings',
|
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
||||||
};
|
|
||||||
const listingType = tabToListingType[this.activeTabAction] as 'businessListings' | 'commercialPropertyListings' | 'brokerListings';
|
if (this.criteria.criteriaType === 'businessListings' || this.criteria.criteriaType === 'commercialPropertyListings') {
|
||||||
|
this.numberOfResults$ = this.listingService.getNumberOfListings(this.criteria.criteriaType === 'businessListings' ? 'business' : 'commercialProperty');
|
||||||
if (this.criteria.criteriaType === 'businessListings' || this.criteria.criteriaType === 'commercialPropertyListings') {
|
} else if (this.criteria.criteriaType === 'brokerListings') {
|
||||||
this.numberOfResults$ = this.listingService.getNumberOfListings(this.criteria.criteriaType === 'businessListings' ? 'business' : 'commercialProperty');
|
this.numberOfResults$ = this.userService.getNumberOfBroker(this.filterStateService.getCriteria('brokerListings') as UserListingCriteria);
|
||||||
} else if (this.criteria.criteriaType === 'brokerListings') {
|
} else {
|
||||||
this.numberOfResults$ = this.userService.getNumberOfBroker(this.filterStateService.getCriteria('brokerListings') as UserListingCriteria);
|
this.numberOfResults$ = of();
|
||||||
} else {
|
}
|
||||||
this.numberOfResults$ = of();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
ngOnDestroy(): void {
|
||||||
|
clearTimeout(this.typingInterval);
|
||||||
ngOnDestroy(): void {
|
}
|
||||||
clearTimeout(this.typingInterval);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,201 +1,201 @@
|
||||||
<div class="container mx-auto px-4 py-8 max-w-4xl">
|
<div class="container mx-auto px-4 py-8 max-w-4xl">
|
||||||
<div class="bg-white rounded-lg drop-shadow-custom-bg p-6 md:p-8 relative">
|
<div class="bg-white rounded-lg drop-shadow-custom-bg p-6 md:p-8 relative">
|
||||||
<button
|
<button
|
||||||
(click)="goBack()"
|
(click)="goBack()"
|
||||||
class="absolute top-4 right-4 md:top-6 md:right-6 w-10 h-10 flex items-center justify-center rounded-full bg-red-600 hover:bg-red-700 text-white transition-colors duration-200"
|
class="absolute top-4 right-4 md:top-6 md:right-6 w-10 h-10 flex items-center justify-center rounded-full bg-red-600 hover:bg-red-700 text-white transition-colors duration-200"
|
||||||
aria-label="Go back"
|
aria-label="Go back"
|
||||||
>
|
>
|
||||||
<i class="fas fa-arrow-left text-lg"></i>
|
<i class="fas fa-arrow-left text-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
<h1 class="text-3xl font-bold text-neutral-900 mb-6 pr-14">Privacy Statement</h1>
|
<h1 class="text-3xl font-bold text-neutral-900 mb-6 pr-14">Privacy Statement</h1>
|
||||||
|
|
||||||
<section id="content" role="main">
|
<section id="content" role="main">
|
||||||
<article class="post page">
|
<article class="post page">
|
||||||
<section class="entry-content">
|
<section class="entry-content">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="font-bold mb-4">Privacy Policy</p>
|
<p class="font-bold mb-4">Privacy Policy</p>
|
||||||
<p class="mb-4">We are committed to protecting your privacy. We have established this statement as a testament to our commitment to your privacy.</p>
|
<p class="mb-4">We are committed to protecting your privacy. We have established this statement as a testament to our commitment to your privacy.</p>
|
||||||
<p class="mb-4">This Privacy Policy relates to the use of any personal information you provide to us through this websites.</p>
|
<p class="mb-4">This Privacy Policy relates to the use of any personal information you provide to us through this websites.</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
By accepting the Privacy Policy during registration or the sending of an enquiry, you expressly consent to our collection, storage, use and disclosure of your personal information as described in this Privacy
|
By accepting the Privacy Policy during registration or the sending of an enquiry, you expressly consent to our collection, storage, use and disclosure of your personal information as described in this Privacy
|
||||||
Policy.
|
Policy.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We may update our Privacy Policy from time to time. Our Privacy Policy was last updated in Febuary 2018 and is effective upon acceptance for new users. By continuing to use our websites or otherwise
|
We may update our Privacy Policy from time to time. Our Privacy Policy was last updated in February 2018 and is effective upon acceptance for new users. By continuing to use our websites or otherwise
|
||||||
continuing to deal with us, you accept this Privacy Policy.
|
continuing to deal with us, you accept this Privacy Policy.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Collection of personal information</p>
|
<p class="font-bold mb-4 mt-6">Collection of personal information</p>
|
||||||
<p class="mb-4">Anyone can browse our websites without revealing any personally identifiable information.</p>
|
<p class="mb-4">Anyone can browse our websites without revealing any personally identifiable information.</p>
|
||||||
<p class="mb-4">However, should you wish to contact a business for sale, a franchise opportunity or an intermediary, we will require you to provide some personal information.</p>
|
<p class="mb-4">However, should you wish to contact a business for sale, a franchise opportunity or an intermediary, we will require you to provide some personal information.</p>
|
||||||
<p class="mb-4">Should you wish to advertise your services, your business (es) or your franchise opportunity, we will require you to provide some personal information.</p>
|
<p class="mb-4">Should you wish to advertise your services, your business (es) or your franchise opportunity, we will require you to provide some personal information.</p>
|
||||||
<p class="mb-4">By providing personal information, you are consenting to the transfer and storage of that information on our servers located in the United States.</p>
|
<p class="mb-4">By providing personal information, you are consenting to the transfer and storage of that information on our servers located in the United States.</p>
|
||||||
<p class="mb-4">We may collect and store the following personal information:</p>
|
<p class="mb-4">We may collect and store the following personal information:</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Your name, email address, physical address, telephone numbers, and (depending on the service used), your business information, financial information, such as credit / payment card details;<br />
|
Your name, email address, physical address, telephone numbers, and (depending on the service used), your business information, financial information, such as credit / payment card details;<br />
|
||||||
transactional information based on your activities on the site; information that you disclose in a forum on any of our websites, feedback, correspondence through our websites, and correspondence sent to
|
transactional information based on your activities on the site; information that you disclose in a forum on any of our websites, feedback, correspondence through our websites, and correspondence sent to
|
||||||
us;<br />
|
us;<br />
|
||||||
other information from your interaction with our websites, services, content and advertising, including computer and connection information, statistics on page views, traffic to and from the sites, ad data,
|
other information from your interaction with our websites, services, content and advertising, including computer and connection information, statistics on page views, traffic to and from the sites, ad data,
|
||||||
IP address and standard web log information;<br />
|
IP address and standard web log information;<br />
|
||||||
supplemental information from third parties (for example, if you incur a debt, we will generally conduct a credit check by obtaining additional information about you from a credit bureau, as permitted by law;
|
supplemental information from third parties (for example, if you incur a debt, we will generally conduct a credit check by obtaining additional information about you from a credit bureau, as permitted by law;
|
||||||
or if the information you provide cannot be verified,<br />
|
or if the information you provide cannot be verified,<br />
|
||||||
we may ask you to send us additional information, or to answer additional questions online to help verify your information).
|
we may ask you to send us additional information, or to answer additional questions online to help verify your information).
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">How we use your information</p>
|
<p class="font-bold mb-4 mt-6">How we use your information</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
The primary reason we collect your personal information is to improve the services we deliver to you through our website. By registering or sending an enquiry through our website, you agree that we may use
|
The primary reason we collect your personal information is to improve the services we deliver to you through our website. By registering or sending an enquiry through our website, you agree that we may use
|
||||||
your personal information to:<br />
|
your personal information to:<br />
|
||||||
provide the services and customer support you request;<br />
|
provide the services and customer support you request;<br />
|
||||||
connect you with relevant parties:<br />
|
connect you with relevant parties:<br />
|
||||||
If you are a buyer we will pass some or all of your details on to the seller / intermediary along with any message you have typed. This allows the seller to contact you in order to pursue a possible sale of a
|
If you are a buyer we will pass some or all of your details on to the seller / intermediary along with any message you have typed. This allows the seller to contact you in order to pursue a possible sale of a
|
||||||
business;<br />
|
business;<br />
|
||||||
If you are a seller / intermediary, we will disclose your details where you have given us permission to do so;<br />
|
If you are a seller / intermediary, we will disclose your details where you have given us permission to do so;<br />
|
||||||
resolve disputes, collect fees, and troubleshoot problems;<br />
|
resolve disputes, collect fees, and troubleshoot problems;<br />
|
||||||
prevent potentially prohibited or illegal activities, and enforce our Terms and Conditions;<br />
|
prevent potentially prohibited or illegal activities, and enforce our Terms and Conditions;<br />
|
||||||
customize, measure and improve our services, conduct internal market research, provide content and advertising;<br />
|
customize, measure and improve our services, conduct internal market research, provide content and advertising;<br />
|
||||||
tell you about other Biz-Match products and services, target marketing, send you service updates, and promotional offers based on your communication preferences.
|
tell you about other Biz-Match products and services, target marketing, send you service updates, and promotional offers based on your communication preferences.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Our disclosure of your information</p>
|
<p class="font-bold mb-4 mt-6">Our disclosure of your information</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We may disclose personal information to respond to legal requirements, enforce our policies, respond to claims that a listing or other content infringes the rights of others, or protect anyone's rights,
|
We may disclose personal information to respond to legal requirements, enforce our policies, respond to claims that a listing or other content infringes the rights of others, or protect anyone's rights,
|
||||||
property, or safety.
|
property, or safety.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We may also share your personal information with<br />
|
We may also share your personal information with<br />
|
||||||
When you select to register an account as a business buyer, you provide your personal details and we will pass this on to a seller of a business or franchise when you request more information.
|
When you select to register an account as a business buyer, you provide your personal details and we will pass this on to a seller of a business or franchise when you request more information.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
When you select to register an account as a business broker or seller on the site, we provide a public platform on which to establish your business profile. This profile consists of pertinent facts about your
|
When you select to register an account as a business broker or seller on the site, we provide a public platform on which to establish your business profile. This profile consists of pertinent facts about your
|
||||||
business along with your personal information; namely, the contact information you provide to facilitate contact between you and other users' of the site. Direct email addresses and telephone numbers will not
|
business along with your personal information; namely, the contact information you provide to facilitate contact between you and other users' of the site. Direct email addresses and telephone numbers will not
|
||||||
be publicly displayed unless you specifically include it on your profile.
|
be publicly displayed unless you specifically include it on your profile.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
The information a user includes within the forums provided on the site is publicly available to other users' of the site. Please be aware that any personal information you elect to provide in a public forum
|
The information a user includes within the forums provided on the site is publicly available to other users' of the site. Please be aware that any personal information you elect to provide in a public forum
|
||||||
may be used to send you unsolicited messages; we are not responsible for the personal information a user elects to disclose within their public profile, or in the private communications that users' engage in
|
may be used to send you unsolicited messages; we are not responsible for the personal information a user elects to disclose within their public profile, or in the private communications that users' engage in
|
||||||
on the site.
|
on the site.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We post testimonials on the site obtained from users'. These testimonials may include the name, city, state or region and business of the user. We obtain permission from our users' prior to posting their
|
We post testimonials on the site obtained from users'. These testimonials may include the name, city, state or region and business of the user. We obtain permission from our users' prior to posting their
|
||||||
testimonials on the site. We are not responsible for any personal information a user selects to include within their testimonial.
|
testimonials on the site. We are not responsible for any personal information a user selects to include within their testimonial.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
When you elect to email a friend about the site, or a particular business, we request the third party's email address to send this one time email. We do not share this information with any third parties for
|
When you elect to email a friend about the site, or a particular business, we request the third party's email address to send this one time email. We do not share this information with any third parties for
|
||||||
their promotional purposes and only store the information to gauge the effectiveness of our referral program.
|
their promotional purposes and only store the information to gauge the effectiveness of our referral program.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">We may share your personal information with our service providers where necessary. We employ the services of a payment processor to fulfil payment for services purchased on the site.</p>
|
<p class="mb-4">We may share your personal information with our service providers where necessary. We employ the services of a payment processor to fulfil payment for services purchased on the site.</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We works with a number of partners or affiliates, where we provide marketing services for these companies. These third party agents collect your personal information to facilitate your service request and the
|
We works with a number of partners or affiliates, where we provide marketing services for these companies. These third party agents collect your personal information to facilitate your service request and the
|
||||||
information submitted here is governed by their privacy policy.
|
information submitted here is governed by their privacy policy.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Masking Policy</p>
|
<p class="font-bold mb-4 mt-6">Masking Policy</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
In some cases, where the third party agent collects your information, the affiliate portal may appear within a BizMatch.net frame. It is presented as a BizMatch.net page for a streamlined user interface
|
In some cases, where the third party agent collects your information, the affiliate portal may appear within a BizMatch.net frame. It is presented as a BizMatch.net page for a streamlined user interface
|
||||||
however the data collected on such pages is governed by the third party agent's privacy policy.
|
however the data collected on such pages is governed by the third party agent's privacy policy.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Legal Disclosure</p>
|
<p class="font-bold mb-4 mt-6">Legal Disclosure</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
In certain circumstances, we may be legally required to disclose information collected on the site to law enforcement, government agencies or other third parties. We reserve the right to disclose information
|
In certain circumstances, we may be legally required to disclose information collected on the site to law enforcement, government agencies or other third parties. We reserve the right to disclose information
|
||||||
to our service providers and to law enforcement or government agencies where a formal request such as in response to a court order, subpoena or judicial proceeding is made. Where we believe in good faith that
|
to our service providers and to law enforcement or government agencies where a formal request such as in response to a court order, subpoena or judicial proceeding is made. Where we believe in good faith that
|
||||||
disclosure of information is necessary to prevent imminent physical or financial harm, or loss, or in protecting against illegal activity on the site, we reserve to disclose information.
|
disclosure of information is necessary to prevent imminent physical or financial harm, or loss, or in protecting against illegal activity on the site, we reserve to disclose information.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Should the company undergo the merger, acquisition or sale of some or all of its assets, your personal information may likely be a part of the transferred assets. In such an event, your personal information
|
Should the company undergo the merger, acquisition or sale of some or all of its assets, your personal information may likely be a part of the transferred assets. In such an event, your personal information
|
||||||
on the site, would be governed by this privacy statement; any changes to the privacy practices governing your information as a result of transfer would be relayed to you by means of a prominent notice on the
|
on the site, would be governed by this privacy statement; any changes to the privacy practices governing your information as a result of transfer would be relayed to you by means of a prominent notice on the
|
||||||
Site, or by email.
|
Site, or by email.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Using information from BizMatch.net website</p>
|
<p class="font-bold mb-4 mt-6">Using information from BizMatch.net website</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
In certain cases, (where you are receiving contact details of buyers interested in your business opportunity or a business opportunity you represent), you must comply with data protection laws, and give other
|
In certain cases, (where you are receiving contact details of buyers interested in your business opportunity or a business opportunity you represent), you must comply with data protection laws, and give other
|
||||||
users a chance to remove themselves from your database and a chance to review what information you have collected about them.
|
users a chance to remove themselves from your database and a chance to review what information you have collected about them.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">You agree to use BizMatch.net user information only for:</p>
|
<p class="font-bold mb-4 mt-6">You agree to use BizMatch.net user information only for:</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
BizMatch.net transaction-related purposes that are not unsolicited commercial messages;<br />
|
BizMatch.net transaction-related purposes that are not unsolicited commercial messages;<br />
|
||||||
using services offered through BizMatch.net, or<br />
|
using services offered through BizMatch.net, or<br />
|
||||||
other purposes that a user expressly chooses.
|
other purposes that a user expressly chooses.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Marketing</p>
|
<p class="font-bold mb-4 mt-6">Marketing</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We do not sell or rent your personal information to third parties for their marketing purposes without your explicit consent. Where you explicitly express your consent at the point of collection to receive
|
We do not sell or rent your personal information to third parties for their marketing purposes without your explicit consent. Where you explicitly express your consent at the point of collection to receive
|
||||||
offers from third party partners or affiliates, we will communicate to you on their behalf. We will not pass your information on.
|
offers from third party partners or affiliates, we will communicate to you on their behalf. We will not pass your information on.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
You will receive email marketing communications from us throughout the duration of your relationship with our websites. If you do not wish to receive marketing communications from us you may unsubscribe and /
|
You will receive email marketing communications from us throughout the duration of your relationship with our websites. If you do not wish to receive marketing communications from us you may unsubscribe and /
|
||||||
or change your preferences at any time by following instructions included within a communication or emailing Customer Services.
|
or change your preferences at any time by following instructions included within a communication or emailing Customer Services.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">If you have an account with one of our websites you can also log in and click the email preferences link to unsubscribe and / or change your preferences.</p>
|
<p class="mb-4">If you have an account with one of our websites you can also log in and click the email preferences link to unsubscribe and / or change your preferences.</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Please note that we reserve the right to send all website users notifications and administrative emails where necessary which are considered a part of the service. Given that these messages aren't promotional
|
Please note that we reserve the right to send all website users notifications and administrative emails where necessary which are considered a part of the service. Given that these messages aren't promotional
|
||||||
in nature, you will be unable to opt-out of them.
|
in nature, you will be unable to opt-out of them.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Cookies</p>
|
<p class="font-bold mb-4 mt-6">Cookies</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
A cookie is a small text file written to your hard drive that contains information about you. Cookies do not contain any personal information about users. Once you close your browser or log out of the
|
A cookie is a small text file written to your hard drive that contains information about you. Cookies do not contain any personal information about users. Once you close your browser or log out of the
|
||||||
website, the cookie simply terminates. We use cookies so that we can personalise your experience of our websites.
|
website, the cookie simply terminates. We use cookies so that we can personalise your experience of our websites.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
If you set up your browser to reject the cookie, you may still use the website however; doing so may interfere with your use of some aspects of our websites. Some of our business partners use cookies on our
|
If you set up your browser to reject the cookie, you may still use the website however; doing so may interfere with your use of some aspects of our websites. Some of our business partners use cookies on our
|
||||||
site (for example, advertisers). We have no access to or control over these cookies.
|
site (for example, advertisers). We have no access to or control over these cookies.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">For more information about how BizMatch.net uses cookies please read our Cookie Policy.</p>
|
<p class="mb-4">For more information about how BizMatch.net uses cookies please read our Cookie Policy.</p>
|
||||||
<p class="font-bold mb-4 mt-6">Spam, spyware or spoofing</p>
|
<p class="font-bold mb-4 mt-6">Spam, spyware or spoofing</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We and our users do not tolerate spam. Make sure to set your email preferences so we can communicate with you, as you prefer. Please add us to your safe senders list. To report spam or spoof emails, please
|
We and our users do not tolerate spam. Make sure to set your email preferences so we can communicate with you, as you prefer. Please add us to your safe senders list. To report spam or spoof emails, please
|
||||||
contact us using the contact information provided in the Contact Us section of this privacy statement.
|
contact us using the contact information provided in the Contact Us section of this privacy statement.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
You may not use our communication tools to send spam or otherwise send content that would breach our Terms and Conditions. We automatically scan and may manually filter messages to check for spam, viruses,
|
You may not use our communication tools to send spam or otherwise send content that would breach our Terms and Conditions. We automatically scan and may manually filter messages to check for spam, viruses,
|
||||||
phishing attacks and other malicious activity or illegal or prohibited content. We may also store these messages for back up purposes only.
|
phishing attacks and other malicious activity or illegal or prohibited content. We may also store these messages for back up purposes only.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
If you send an email to an email address that is not registered in our community, we do not permanently store that email or use that email address for any marketing purpose. We do not rent or sell these email
|
If you send an email to an email address that is not registered in our community, we do not permanently store that email or use that email address for any marketing purpose. We do not rent or sell these email
|
||||||
addresses.
|
addresses.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Account protection</p>
|
<p class="font-bold mb-4 mt-6">Account protection</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Your password is the key to your account. Make sure this is stored safely. Use unique numbers, letters and special characters, and do not disclose your password to anyone. If you do share your password or
|
Your password is the key to your account. Make sure this is stored safely. Use unique numbers, letters and special characters, and do not disclose your password to anyone. If you do share your password or
|
||||||
your personal information with others, remember that you are responsible for all actions taken in the name of your account. If you lose control of your password, you may lose substantial control over your
|
your personal information with others, remember that you are responsible for all actions taken in the name of your account. If you lose control of your password, you may lose substantial control over your
|
||||||
personal information and may be subject to legally binding actions taken on your behalf. Therefore, if your password has been compromised for any reason, you should immediately notify us and change your
|
personal information and may be subject to legally binding actions taken on your behalf. Therefore, if your password has been compromised for any reason, you should immediately notify us and change your
|
||||||
password.
|
password.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Accessing, reviewing and changing your personal information</p>
|
<p class="font-bold mb-4 mt-6">Accessing, reviewing and changing your personal information</p>
|
||||||
<p class="mb-4">You can view and amend your personal information at any time by logging in to your account online. You must promptly update your personal information if it changes or is inaccurate.</p>
|
<p class="mb-4">You can view and amend your personal information at any time by logging in to your account online. You must promptly update your personal information if it changes or is inaccurate.</p>
|
||||||
<p class="mb-4">If at any time you wish to close your account, please contact Customer Services and instruct us to do so. We will process your request as soon as we can.</p>
|
<p class="mb-4">If at any time you wish to close your account, please contact Customer Services and instruct us to do so. We will process your request as soon as we can.</p>
|
||||||
<p class="mb-4">You may also contact us at any time to find out what information we hold about you, what we do with it and ask us to update it for you.</p>
|
<p class="mb-4">You may also contact us at any time to find out what information we hold about you, what we do with it and ask us to update it for you.</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We do retain personal information from closed accounts to comply with law, prevent fraud, collect any fees owed, resolve disputes, troubleshoot problems, assist with any investigations, enforce our Terms and
|
We do retain personal information from closed accounts to comply with law, prevent fraud, collect any fees owed, resolve disputes, troubleshoot problems, assist with any investigations, enforce our Terms and
|
||||||
Conditions, and take other actions otherwise permitted by law.
|
Conditions, and take other actions otherwise permitted by law.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Security</p>
|
<p class="font-bold mb-4 mt-6">Security</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Your information is stored on our servers located in the USA. We treat data as an asset that must be protected and use a variety of tools (encryption, passwords, physical security, etc.) to protect your
|
Your information is stored on our servers located in the USA. We treat data as an asset that must be protected and use a variety of tools (encryption, passwords, physical security, etc.) to protect your
|
||||||
personal information against unauthorized access and disclosure. However, no method of security is 100% effective and while we take every measure to protect your personal information, we make no guarantees of
|
personal information against unauthorized access and disclosure. However, no method of security is 100% effective and while we take every measure to protect your personal information, we make no guarantees of
|
||||||
its absolute security.
|
its absolute security.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">We employ the use of SSL encryption during the transmission of sensitive data across our websites.</p>
|
<p class="mb-4">We employ the use of SSL encryption during the transmission of sensitive data across our websites.</p>
|
||||||
<p class="font-bold mb-4 mt-6">Third parties</p>
|
<p class="font-bold mb-4 mt-6">Third parties</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Except as otherwise expressly included in this Privacy Policy, this document addresses only the use and disclosure of information we collect from you. If you disclose your information to others, whether they
|
Except as otherwise expressly included in this Privacy Policy, this document addresses only the use and disclosure of information we collect from you. If you disclose your information to others, whether they
|
||||||
are buyers or sellers on our websites or other sites throughout the internet, different rules may apply to their use or disclosure of the information you disclose to them. Dynamis does not control the privacy
|
are buyers or sellers on our websites or other sites throughout the internet, different rules may apply to their use or disclosure of the information you disclose to them. Dynamis does not control the privacy
|
||||||
policies of third parties, and you are subject to the privacy policies of those third parties where applicable.
|
policies of third parties, and you are subject to the privacy policies of those third parties where applicable.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">We encourage you to ask questions before you disclose your personal information to others.</p>
|
<p class="mb-4">We encourage you to ask questions before you disclose your personal information to others.</p>
|
||||||
<p class="font-bold mb-4 mt-6">General</p>
|
<p class="font-bold mb-4 mt-6">General</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
We may change this Privacy Policy from time to time as we add new products and applications, as we improve our current offerings, and as technologies and laws change. You can determine when this Privacy
|
We may change this Privacy Policy from time to time as we add new products and applications, as we improve our current offerings, and as technologies and laws change. You can determine when this Privacy
|
||||||
Policy was last revised by referring to the "Last Updated" legend at the top of this page.
|
Policy was last revised by referring to the "Last Updated" legend at the top of this page.
|
||||||
</p>
|
</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
Any changes will become effective upon our posting of the revised Privacy Policy on our affected websites. We will provide notice to you if these changes are material and, where required by applicable law, we
|
Any changes will become effective upon our posting of the revised Privacy Policy on our affected websites. We will provide notice to you if these changes are material and, where required by applicable law, we
|
||||||
will obtain your consent. This notice may be provided by email, by posting notice of the changes on our affected websites or by other means, consistent with applicable laws.
|
will obtain your consent. This notice may be provided by email, by posting notice of the changes on our affected websites or by other means, consistent with applicable laws.
|
||||||
</p>
|
</p>
|
||||||
<p class="font-bold mb-4 mt-6">Contact Us</p>
|
<p class="font-bold mb-4 mt-6">Contact Us</p>
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
If you have any questions or comments about our privacy policy, and you can't find the answer to your question on our help pages, please contact us using this form or email support@bizmatch.net, or write
|
If you have any questions or comments about our privacy policy, and you can't find the answer to your question on our help pages, please contact us using this form or email support@bizmatch.net, or write
|
||||||
to us at BizMatch, 715 S. Tanahua, Corpus Christi, TX 78401.)
|
to us at BizMatch, 715 S. Tanahua, Corpus Christi, TX 78401.)
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,159 +1,162 @@
|
||||||
<div class="flex flex-col md:flex-row">
|
<div class="flex flex-col md:flex-row">
|
||||||
<!-- Filter Panel for Desktop -->
|
<!-- Filter Panel for Desktop -->
|
||||||
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
||||||
<app-search-modal-broker [isModal]="false"></app-search-modal-broker>
|
<app-search-modal-broker [isModal]="false"></app-search-modal-broker>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<div class="w-full p-4">
|
<div class="w-full p-4">
|
||||||
<div class="container mx-auto">
|
<div class="container mx-auto">
|
||||||
<!-- Breadcrumbs -->
|
<!-- Breadcrumbs -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- SEO-optimized heading -->
|
<!-- SEO-optimized heading -->
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Professional Business Brokers & Advisors</h1>
|
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Professional Business Brokers & Advisors</h1>
|
||||||
<p class="text-lg text-neutral-600">Connect with licensed business brokers, CPAs, attorneys, and other
|
<p class="text-lg text-neutral-600">Connect with licensed business brokers, CPAs, attorneys, and other
|
||||||
professionals across the United States.</p>
|
professionals across the United States.</p>
|
||||||
</div>
|
<div class="mt-4 text-base text-neutral-700 max-w-4xl">
|
||||||
|
<p>BizMatch connects business buyers and sellers with experienced professionals. Find qualified business brokers to help with your business sale or acquisition. Our platform features verified professionals including business brokers, M&A advisors, CPAs, and attorneys specializing in business transactions across the United States. Whether you're looking to buy or sell a business, our network of professionals can guide you through the process.</p>
|
||||||
<!-- Mobile Filter Button -->
|
</div>
|
||||||
<div class="md:hidden mb-4">
|
</div>
|
||||||
<button (click)="openFilterModal()"
|
|
||||||
class="w-full bg-primary-600 text-white py-3 px-4 rounded-lg flex items-center justify-center">
|
<!-- Mobile Filter Button -->
|
||||||
<i class="fas fa-filter mr-2"></i>
|
<div class="md:hidden mb-4">
|
||||||
Filter Results
|
<button (click)="openFilterModal()"
|
||||||
</button>
|
class="w-full bg-primary-600 text-white py-3 px-4 rounded-lg flex items-center justify-center">
|
||||||
</div>
|
<i class="fas fa-filter mr-2"></i>
|
||||||
|
Filter Results
|
||||||
@if(users?.length>0){
|
</button>
|
||||||
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Professional Listings</h2>
|
</div>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
<!-- Professional Cards -->
|
@if(users?.length>0){
|
||||||
@for (user of users; track user) {
|
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Professional Listings</h2>
|
||||||
<div
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg p-6 flex flex-col justify-between hover:shadow-2xl transition-all duration-300 hover:scale-[1.02] group relative">
|
<!-- Professional Cards -->
|
||||||
<!-- Quick Actions Overlay -->
|
@for (user of users; track user) {
|
||||||
<div
|
<div
|
||||||
class="absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-20">
|
class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg p-6 flex flex-col justify-between hover:shadow-2xl transition-all duration-300 hover:scale-[1.02] group relative">
|
||||||
@if(currentUser) {
|
<!-- Quick Actions Overlay -->
|
||||||
<button type="button" class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
<div
|
||||||
[class.bg-red-50]="isFavorite(user)"
|
class="absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-20">
|
||||||
[title]="isFavorite(user) ? 'Remove from favorites' : 'Save to favorites'"
|
@if(currentUser) {
|
||||||
(click)="toggleFavorite($event, user)">
|
<button type="button" class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
||||||
<i
|
[class.bg-red-50]="isFavorite(user)"
|
||||||
[class]="isFavorite(user) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
[title]="isFavorite(user) ? 'Remove from favorites' : 'Save to favorites'"
|
||||||
</button>
|
(click)="toggleFavorite($event, user)">
|
||||||
}
|
<i
|
||||||
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
[class]="isFavorite(user) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
||||||
title="Share professional" (click)="shareProfessional($event, user)">
|
</button>
|
||||||
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
}
|
||||||
</button>
|
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
||||||
</div>
|
title="Share professional" (click)="shareProfessional($event, user)">
|
||||||
<div class="flex items-start space-x-4">
|
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
||||||
@if(user.hasProfile){
|
</button>
|
||||||
<img src="{{ env.imageBaseUrl }}/pictures/profile/{{ emailToDirName(user.email) }}.avif?_ts={{ ts }}"
|
</div>
|
||||||
[alt]="altText.generateBrokerProfileAlt(user)" class="rounded-md w-20 h-26 object-cover" width="80"
|
<div class="flex items-start space-x-4">
|
||||||
height="104" />
|
@if(user.hasProfile){
|
||||||
} @else {
|
<img src="{{ env.imageBaseUrl }}/pictures/profile/{{ emailToDirName(user.email) }}.avif?_ts={{ ts }}"
|
||||||
<img src="/assets/images/person_placeholder.jpg" alt="Default business broker placeholder profile photo"
|
[alt]="altText.generateBrokerProfileAlt(user)" class="rounded-md w-20 h-26 object-cover" width="80"
|
||||||
class="rounded-md w-20 h-26 object-cover" width="80" height="104" />
|
height="104" />
|
||||||
}
|
} @else {
|
||||||
<div class="flex-1">
|
<img src="/assets/images/person_placeholder.jpg" alt="Default business broker placeholder profile photo"
|
||||||
<p class="text-sm text-neutral-800 mb-2">{{ user.description }}</p>
|
class="rounded-md w-20 h-26 object-cover" width="80" height="104" />
|
||||||
<h3 class="text-lg font-semibold">
|
}
|
||||||
{{ user.firstname }} {{ user.lastname }}<span
|
<div class="flex-1">
|
||||||
class="bg-neutral-200 text-neutral-700 text-xs font-semibold px-2 py-1 rounded ml-4">{{
|
<p class="text-sm text-neutral-800 mb-2">{{ user.description }}</p>
|
||||||
user.location?.name }} - {{ user.location?.state }}</span>
|
<h3 class="text-lg font-semibold">
|
||||||
</h3>
|
{{ user.firstname }} {{ user.lastname }}<span
|
||||||
<div class="flex items-center space-x-2 mt-2">
|
class="bg-neutral-200 text-neutral-700 text-xs font-semibold px-2 py-1 rounded ml-4">{{
|
||||||
<app-customer-sub-type [customerSubType]="user.customerSubType"></app-customer-sub-type>
|
user.location?.name }} - {{ user.location?.state }}</span>
|
||||||
<p class="text-sm text-neutral-600">{{ user.companyName }}</p>
|
</h3>
|
||||||
</div>
|
<div class="flex items-center space-x-2 mt-2">
|
||||||
<div class="flex items-center justify-between my-2"></div>
|
<app-customer-sub-type [customerSubType]="user.customerSubType"></app-customer-sub-type>
|
||||||
</div>
|
<p class="text-sm text-neutral-600">{{ user.companyName }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4 flex justify-between items-center">
|
<div class="flex items-center justify-between my-2"></div>
|
||||||
@if(user.hasCompanyLogo){
|
</div>
|
||||||
<img src="{{ env.imageBaseUrl }}/pictures/logo/{{ emailToDirName(user.email) }}.avif?_ts={{ ts }}"
|
</div>
|
||||||
[alt]="altText.generateCompanyLogoAlt(user.companyName, user.firstname + ' ' + user.lastname)"
|
<div class="mt-4 flex justify-between items-center">
|
||||||
class="w-8 h-10 object-contain" width="32" height="40" />
|
@if(user.hasCompanyLogo){
|
||||||
} @else {
|
<img src="{{ env.imageBaseUrl }}/pictures/logo/{{ emailToDirName(user.email) }}.avif?_ts={{ ts }}"
|
||||||
<img src="/assets/images/placeholder.png" alt="Default company logo placeholder"
|
[alt]="altText.generateCompanyLogoAlt(user.companyName, user.firstname + ' ' + user.lastname)"
|
||||||
class="w-8 h-10 object-contain" width="32" height="40" />
|
class="w-8 h-10 object-contain" width="32" height="40" />
|
||||||
}
|
} @else {
|
||||||
<button
|
<img src="/assets/images/placeholder.png" alt="Default company logo placeholder"
|
||||||
class="bg-success-500 hover:bg-success-600 text-white font-medium py-2 px-4 rounded-full flex items-center"
|
class="w-8 h-10 object-contain" width="32" height="40" />
|
||||||
[routerLink]="['/details-user', user.id]">
|
}
|
||||||
View Full profile
|
<button
|
||||||
<i class="fas fa-arrow-right ml-2"></i>
|
class="bg-success-500 hover:bg-success-600 text-white font-medium py-2 px-4 rounded-full flex items-center"
|
||||||
</button>
|
[routerLink]="['/details-user', user.id]">
|
||||||
</div>
|
View Full profile
|
||||||
</div>
|
<i class="fas fa-arrow-right ml-2"></i>
|
||||||
}
|
</button>
|
||||||
</div>
|
</div>
|
||||||
} @else if (users?.length===0){
|
</div>
|
||||||
<!-- Empty State -->
|
}
|
||||||
<div class="w-full flex items-center flex-wrap justify-center gap-10 py-12">
|
</div>
|
||||||
<div class="grid gap-4 w-60">
|
} @else if (users?.length===0){
|
||||||
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161"
|
<!-- Empty State -->
|
||||||
fill="none">
|
<div class="w-full flex items-center flex-wrap justify-center gap-10 py-12">
|
||||||
<path
|
<div class="grid gap-4 w-60">
|
||||||
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161"
|
||||||
fill="#EEF2FF" />
|
fill="none">
|
||||||
<path
|
<path
|
||||||
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
||||||
fill="white" stroke="#E5E7EB" />
|
fill="#EEF2FF" />
|
||||||
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
<path
|
||||||
<path
|
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
||||||
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
fill="white" stroke="#E5E7EB" />
|
||||||
stroke="#E5E7EB" />
|
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
||||||
<path
|
<path
|
||||||
d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z"
|
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
||||||
stroke="#E5E7EB" />
|
stroke="#E5E7EB" />
|
||||||
<path
|
<path
|
||||||
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z"
|
||||||
fill="#A5B4FC" stroke="#818CF8" />
|
stroke="#E5E7EB" />
|
||||||
<path
|
<path
|
||||||
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 83.3821 77.9987 83.3821 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
||||||
fill="#4F46E5" />
|
fill="#A5B4FC" stroke="#818CF8" />
|
||||||
<path
|
<path
|
||||||
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 83.3821 77.9987 83.3821 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
||||||
fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<path
|
<path
|
||||||
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
||||||
fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
<path
|
||||||
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
||||||
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
||||||
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
</svg>
|
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<div>
|
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<h2 class="text-center text-black text-xl font-semibold leading-loose pb-2">There're no professionals here
|
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
</h2>
|
</svg>
|
||||||
<p class="text-center text-black text-base font-normal leading-relaxed pb-4">Try changing your filters to
|
<div>
|
||||||
<br />see professionals
|
<h2 class="text-center text-black text-xl font-semibold leading-loose pb-2">There're no professionals here
|
||||||
</p>
|
</h2>
|
||||||
<div class="flex gap-3">
|
<p class="text-center text-black text-base font-normal leading-relaxed pb-4">Try changing your filters to
|
||||||
<button (click)="clearAllFilters()"
|
<br />see professionals
|
||||||
class="w-full px-3 py-2 rounded-full border border-neutral-300 text-neutral-900 text-xs font-semibold leading-4">Clear
|
</p>
|
||||||
Filter</button>
|
<div class="flex gap-3">
|
||||||
</div>
|
<button (click)="clearAllFilters()"
|
||||||
</div>
|
class="w-full px-3 py-2 rounded-full border border-neutral-300 text-neutral-900 text-xs font-semibold leading-4">Clear
|
||||||
</div>
|
Filter</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
|
</div>
|
||||||
<!-- Pagination -->
|
</div>
|
||||||
@if(pageCount>1){
|
}
|
||||||
<div class="mt-8">
|
|
||||||
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
<!-- Pagination -->
|
||||||
</div>
|
@if(pageCount>1){
|
||||||
}
|
<div class="mt-8">
|
||||||
</div>
|
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,243 +1,244 @@
|
||||||
import { CommonModule, NgOptimizedImage } from '@angular/common';
|
import { CommonModule, NgOptimizedImage } from '@angular/common';
|
||||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||||
import { UntilDestroy } from '@ngneat/until-destroy';
|
import { UntilDestroy } from '@ngneat/until-destroy';
|
||||||
import { Subject, takeUntil } from 'rxjs';
|
import { Subject, takeUntil } from 'rxjs';
|
||||||
import { BusinessListing, SortByOptions, User } from '../../../../../../bizmatch-server/src/models/db.model';
|
import { BusinessListing, SortByOptions, User } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||||
import { LISTINGS_PER_PAGE, ListingType, UserListingCriteria, emailToDirName, KeycloakUser } from '../../../../../../bizmatch-server/src/models/main.model';
|
import { LISTINGS_PER_PAGE, ListingType, UserListingCriteria, emailToDirName, KeycloakUser } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
||||||
import { CustomerSubTypeComponent } from '../../../components/customer-sub-type/customer-sub-type.component';
|
import { CustomerSubTypeComponent } from '../../../components/customer-sub-type/customer-sub-type.component';
|
||||||
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
||||||
import { SearchModalBrokerComponent } from '../../../components/search-modal/search-modal-broker.component';
|
import { SearchModalBrokerComponent } from '../../../components/search-modal/search-modal-broker.component';
|
||||||
import { ModalService } from '../../../components/search-modal/modal.service';
|
import { ModalService } from '../../../components/search-modal/modal.service';
|
||||||
import { AltTextService } from '../../../services/alt-text.service';
|
import { AltTextService } from '../../../services/alt-text.service';
|
||||||
import { CriteriaChangeService } from '../../../services/criteria-change.service';
|
import { CriteriaChangeService } from '../../../services/criteria-change.service';
|
||||||
import { FilterStateService } from '../../../services/filter-state.service';
|
import { FilterStateService } from '../../../services/filter-state.service';
|
||||||
import { ImageService } from '../../../services/image.service';
|
import { ImageService } from '../../../services/image.service';
|
||||||
import { ListingsService } from '../../../services/listings.service';
|
import { ListingsService } from '../../../services/listings.service';
|
||||||
import { SearchService } from '../../../services/search.service';
|
import { SearchService } from '../../../services/search.service';
|
||||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||||
import { UserService } from '../../../services/user.service';
|
import { UserService } from '../../../services/user.service';
|
||||||
import { AuthService } from '../../../services/auth.service';
|
import { AuthService } from '../../../services/auth.service';
|
||||||
import { assignProperties, resetUserListingCriteria, map2User } from '../../../utils/utils';
|
import { assignProperties, resetUserListingCriteria, map2User } from '../../../utils/utils';
|
||||||
@UntilDestroy()
|
@UntilDestroy()
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-broker-listings',
|
selector: 'app-broker-listings',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, CustomerSubTypeComponent, BreadcrumbsComponent, SearchModalBrokerComponent],
|
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, CustomerSubTypeComponent, BreadcrumbsComponent, SearchModalBrokerComponent],
|
||||||
templateUrl: './broker-listings.component.html',
|
templateUrl: './broker-listings.component.html',
|
||||||
styleUrls: ['./broker-listings.component.scss', '../../pages.scss'],
|
styleUrls: ['./broker-listings.component.scss', '../../pages.scss'],
|
||||||
})
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
export class BrokerListingsComponent implements OnInit, OnDestroy {
|
})
|
||||||
private destroy$ = new Subject<void>();
|
export class BrokerListingsComponent implements OnInit, OnDestroy {
|
||||||
breadcrumbs: BreadcrumbItem[] = [
|
private destroy$ = new Subject<void>();
|
||||||
{ label: 'Home', url: '/home', icon: 'fas fa-home' },
|
breadcrumbs: BreadcrumbItem[] = [
|
||||||
{ label: 'Professionals', url: '/brokerListings' }
|
{ label: 'Home', url: '/home', icon: 'fas fa-home' },
|
||||||
];
|
{ label: 'Professionals', url: '/brokerListings' }
|
||||||
environment = environment;
|
];
|
||||||
listings: Array<BusinessListing>;
|
environment = environment;
|
||||||
users: Array<User>;
|
listings: Array<BusinessListing>;
|
||||||
filteredListings: Array<ListingType>;
|
users: Array<User>;
|
||||||
criteria: UserListingCriteria;
|
filteredListings: Array<ListingType>;
|
||||||
realEstateChecked: boolean;
|
criteria: UserListingCriteria;
|
||||||
maxPrice: string;
|
realEstateChecked: boolean;
|
||||||
minPrice: string;
|
maxPrice: string;
|
||||||
type: string;
|
minPrice: string;
|
||||||
statesSet = new Set();
|
type: string;
|
||||||
state: string;
|
statesSet = new Set();
|
||||||
first: number = 0;
|
state: string;
|
||||||
rows: number = 12;
|
first: number = 0;
|
||||||
totalRecords: number = 0;
|
rows: number = 12;
|
||||||
ts = new Date().getTime();
|
totalRecords: number = 0;
|
||||||
env = environment;
|
ts = new Date().getTime();
|
||||||
public category: 'business' | 'commercialProperty' | 'professionals_brokers' | undefined;
|
env = environment;
|
||||||
emailToDirName = emailToDirName;
|
public category: 'business' | 'commercialProperty' | 'professionals_brokers' | undefined;
|
||||||
page = 1;
|
emailToDirName = emailToDirName;
|
||||||
pageCount = 1;
|
page = 1;
|
||||||
sortBy: SortByOptions = null; // Neu: Separate Property
|
pageCount = 1;
|
||||||
currentUser: KeycloakUser | null = null; // Current logged-in user
|
sortBy: SortByOptions = null; // Neu: Separate Property
|
||||||
constructor(
|
currentUser: KeycloakUser | null = null; // Current logged-in user
|
||||||
public altText: AltTextService,
|
constructor(
|
||||||
public selectOptions: SelectOptionsService,
|
public altText: AltTextService,
|
||||||
private listingsService: ListingsService,
|
public selectOptions: SelectOptionsService,
|
||||||
private userService: UserService,
|
private listingsService: ListingsService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private userService: UserService,
|
||||||
private router: Router,
|
private activatedRoute: ActivatedRoute,
|
||||||
private cdRef: ChangeDetectorRef,
|
private router: Router,
|
||||||
private imageService: ImageService,
|
private cdRef: ChangeDetectorRef,
|
||||||
private route: ActivatedRoute,
|
private imageService: ImageService,
|
||||||
private searchService: SearchService,
|
private route: ActivatedRoute,
|
||||||
private modalService: ModalService,
|
private searchService: SearchService,
|
||||||
private criteriaChangeService: CriteriaChangeService,
|
private modalService: ModalService,
|
||||||
private filterStateService: FilterStateService,
|
private criteriaChangeService: CriteriaChangeService,
|
||||||
private authService: AuthService,
|
private filterStateService: FilterStateService,
|
||||||
) {
|
private authService: AuthService,
|
||||||
this.loadSortBy();
|
) {
|
||||||
}
|
this.loadSortBy();
|
||||||
private loadSortBy() {
|
}
|
||||||
const storedSortBy = sessionStorage.getItem('professionalsSortBy');
|
private loadSortBy() {
|
||||||
this.sortBy = storedSortBy && storedSortBy !== 'null' ? (storedSortBy as SortByOptions) : null;
|
const storedSortBy = sessionStorage.getItem('professionalsSortBy');
|
||||||
}
|
this.sortBy = storedSortBy && storedSortBy !== 'null' ? (storedSortBy as SortByOptions) : null;
|
||||||
async ngOnInit(): Promise<void> {
|
}
|
||||||
// Get current logged-in user
|
async ngOnInit(): Promise<void> {
|
||||||
const token = await this.authService.getToken();
|
// Get current logged-in user
|
||||||
this.currentUser = map2User(token);
|
const token = await this.authService.getToken();
|
||||||
|
this.currentUser = map2User(token);
|
||||||
// Subscribe to FilterStateService for criteria changes
|
|
||||||
this.filterStateService
|
// Subscribe to FilterStateService for criteria changes
|
||||||
.getState$('brokerListings')
|
this.filterStateService
|
||||||
.pipe(takeUntil(this.destroy$))
|
.getState$('brokerListings')
|
||||||
.subscribe(state => {
|
.pipe(takeUntil(this.destroy$))
|
||||||
this.criteria = state.criteria as UserListingCriteria;
|
.subscribe(state => {
|
||||||
this.sortBy = state.sortBy;
|
this.criteria = state.criteria as UserListingCriteria;
|
||||||
this.search();
|
this.sortBy = state.sortBy;
|
||||||
});
|
this.search();
|
||||||
|
});
|
||||||
// Subscribe to SearchService for search triggers
|
|
||||||
this.searchService.searchTrigger$
|
// Subscribe to SearchService for search triggers
|
||||||
.pipe(takeUntil(this.destroy$))
|
this.searchService.searchTrigger$
|
||||||
.subscribe(type => {
|
.pipe(takeUntil(this.destroy$))
|
||||||
if (type === 'brokerListings') {
|
.subscribe(type => {
|
||||||
this.search();
|
if (type === 'brokerListings') {
|
||||||
}
|
this.search();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.destroy$.next();
|
ngOnDestroy(): void {
|
||||||
this.destroy$.complete();
|
this.destroy$.next();
|
||||||
}
|
this.destroy$.complete();
|
||||||
async search() {
|
}
|
||||||
const usersReponse = await this.userService.search(this.criteria);
|
async search() {
|
||||||
this.users = usersReponse.results;
|
const usersReponse = await this.userService.search(this.criteria);
|
||||||
this.totalRecords = usersReponse.totalCount;
|
this.users = usersReponse.results;
|
||||||
this.pageCount = this.totalRecords % LISTINGS_PER_PAGE === 0 ? this.totalRecords / LISTINGS_PER_PAGE : Math.floor(this.totalRecords / LISTINGS_PER_PAGE) + 1;
|
this.totalRecords = usersReponse.totalCount;
|
||||||
this.page = this.criteria.page ? this.criteria.page : 1;
|
this.pageCount = this.totalRecords % LISTINGS_PER_PAGE === 0 ? this.totalRecords / LISTINGS_PER_PAGE : Math.floor(this.totalRecords / LISTINGS_PER_PAGE) + 1;
|
||||||
this.cdRef.markForCheck();
|
this.page = this.criteria.page ? this.criteria.page : 1;
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.markForCheck();
|
||||||
}
|
this.cdRef.detectChanges();
|
||||||
onPageChange(page: any) {
|
}
|
||||||
this.criteria.start = (page - 1) * LISTINGS_PER_PAGE;
|
onPageChange(page: any) {
|
||||||
this.criteria.length = LISTINGS_PER_PAGE;
|
this.criteria.start = (page - 1) * LISTINGS_PER_PAGE;
|
||||||
this.criteria.page = page;
|
this.criteria.length = LISTINGS_PER_PAGE;
|
||||||
this.search();
|
this.criteria.page = page;
|
||||||
}
|
this.search();
|
||||||
|
}
|
||||||
reset() { }
|
|
||||||
|
reset() { }
|
||||||
// New methods for filter actions
|
|
||||||
clearAllFilters() {
|
// New methods for filter actions
|
||||||
// Reset criteria to default values
|
clearAllFilters() {
|
||||||
resetUserListingCriteria(this.criteria);
|
// Reset criteria to default values
|
||||||
|
resetUserListingCriteria(this.criteria);
|
||||||
// Reset pagination
|
|
||||||
this.criteria.page = 1;
|
// Reset pagination
|
||||||
this.criteria.start = 0;
|
this.criteria.page = 1;
|
||||||
|
this.criteria.start = 0;
|
||||||
this.criteriaChangeService.notifyCriteriaChange();
|
|
||||||
|
this.criteriaChangeService.notifyCriteriaChange();
|
||||||
// Search with cleared filters
|
|
||||||
this.searchService.search('brokerListings');
|
// Search with cleared filters
|
||||||
}
|
this.searchService.search('brokerListings');
|
||||||
|
}
|
||||||
async openFilterModal() {
|
|
||||||
// Open the search modal with current criteria
|
async openFilterModal() {
|
||||||
const modalResult = await this.modalService.showModal(this.criteria);
|
// Open the search modal with current criteria
|
||||||
if (modalResult.accepted) {
|
const modalResult = await this.modalService.showModal(this.criteria);
|
||||||
this.searchService.search('brokerListings');
|
if (modalResult.accepted) {
|
||||||
} else {
|
this.searchService.search('brokerListings');
|
||||||
this.criteria = assignProperties(this.criteria, modalResult.criteria);
|
} else {
|
||||||
}
|
this.criteria = assignProperties(this.criteria, modalResult.criteria);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Check if professional/user is already in current user's favorites
|
/**
|
||||||
*/
|
* Check if professional/user is already in current user's favorites
|
||||||
isFavorite(professional: User): boolean {
|
*/
|
||||||
if (!this.currentUser?.email || !professional.favoritesForUser) return false;
|
isFavorite(professional: User): boolean {
|
||||||
return professional.favoritesForUser.includes(this.currentUser.email);
|
if (!this.currentUser?.email || !professional.favoritesForUser) return false;
|
||||||
}
|
return professional.favoritesForUser.includes(this.currentUser.email);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Toggle favorite status for a professional
|
/**
|
||||||
*/
|
* Toggle favorite status for a professional
|
||||||
async toggleFavorite(event: Event, professional: User): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async toggleFavorite(event: Event, professional: User): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
if (!this.currentUser?.email) {
|
|
||||||
// User not logged in - redirect to login
|
if (!this.currentUser?.email) {
|
||||||
this.router.navigate(['/login']);
|
// User not logged in - redirect to login
|
||||||
return;
|
this.router.navigate(['/login']);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
try {
|
|
||||||
console.log('Toggling favorite for:', professional.email, 'Current user:', this.currentUser.email);
|
try {
|
||||||
console.log('Before update, favorites:', professional.favoritesForUser);
|
console.log('Toggling favorite for:', professional.email, 'Current user:', this.currentUser.email);
|
||||||
|
console.log('Before update, favorites:', professional.favoritesForUser);
|
||||||
if (this.isFavorite(professional)) {
|
|
||||||
// Remove from favorites
|
if (this.isFavorite(professional)) {
|
||||||
await this.listingsService.removeFavorite(professional.id, 'user');
|
// Remove from favorites
|
||||||
professional.favoritesForUser = professional.favoritesForUser.filter(
|
await this.listingsService.removeFavorite(professional.id, 'user');
|
||||||
email => email !== this.currentUser!.email
|
professional.favoritesForUser = professional.favoritesForUser.filter(
|
||||||
);
|
email => email !== this.currentUser!.email
|
||||||
} else {
|
);
|
||||||
// Add to favorites
|
} else {
|
||||||
await this.listingsService.addToFavorites(professional.id, 'user');
|
// Add to favorites
|
||||||
if (!professional.favoritesForUser) {
|
await this.listingsService.addToFavorites(professional.id, 'user');
|
||||||
professional.favoritesForUser = [];
|
if (!professional.favoritesForUser) {
|
||||||
}
|
professional.favoritesForUser = [];
|
||||||
// Use spread to create new array reference
|
}
|
||||||
professional.favoritesForUser = [...professional.favoritesForUser, this.currentUser.email];
|
// Use spread to create new array reference
|
||||||
}
|
professional.favoritesForUser = [...professional.favoritesForUser, this.currentUser.email];
|
||||||
|
}
|
||||||
console.log('After update, favorites:', professional.favoritesForUser);
|
|
||||||
this.cdRef.markForCheck();
|
console.log('After update, favorites:', professional.favoritesForUser);
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.markForCheck();
|
||||||
} catch (error) {
|
this.cdRef.detectChanges();
|
||||||
console.error('Error toggling favorite:', error);
|
} catch (error) {
|
||||||
}
|
console.error('Error toggling favorite:', error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Share professional profile
|
/**
|
||||||
*/
|
* Share professional profile
|
||||||
async shareProfessional(event: Event, user: User): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async shareProfessional(event: Event, user: User): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
const url = `${window.location.origin}/details-user/${user.id}`;
|
|
||||||
const title = `${user.firstname} ${user.lastname} - ${user.companyName}`;
|
const url = `${window.location.origin}/details-user/${user.id}`;
|
||||||
|
const title = `${user.firstname} ${user.lastname} - ${user.companyName}`;
|
||||||
// Try native share API first (works on mobile and some desktop browsers)
|
|
||||||
if (navigator.share) {
|
// Try native share API first (works on mobile and some desktop browsers)
|
||||||
try {
|
if (navigator.share) {
|
||||||
await navigator.share({
|
try {
|
||||||
title: title,
|
await navigator.share({
|
||||||
text: `Check out this professional: ${title}`,
|
title: title,
|
||||||
url: url,
|
text: `Check out this professional: ${title}`,
|
||||||
});
|
url: url,
|
||||||
} catch (err) {
|
});
|
||||||
// User cancelled or share failed - fall back to clipboard
|
} catch (err) {
|
||||||
this.copyToClipboard(url);
|
// User cancelled or share failed - fall back to clipboard
|
||||||
}
|
this.copyToClipboard(url);
|
||||||
} else {
|
}
|
||||||
// Fallback: open Facebook share dialog
|
} else {
|
||||||
const encodedUrl = encodeURIComponent(url);
|
// Fallback: open Facebook share dialog
|
||||||
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
const encodedUrl = encodeURIComponent(url);
|
||||||
}
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Copy URL to clipboard and show feedback
|
/**
|
||||||
*/
|
* Copy URL to clipboard and show feedback
|
||||||
private copyToClipboard(url: string): void {
|
*/
|
||||||
navigator.clipboard.writeText(url).then(() => {
|
private copyToClipboard(url: string): void {
|
||||||
console.log('Link copied to clipboard!');
|
navigator.clipboard.writeText(url).then(() => {
|
||||||
}).catch(err => {
|
console.log('Link copied to clipboard!');
|
||||||
console.error('Failed to copy link:', err);
|
}).catch(err => {
|
||||||
});
|
console.error('Failed to copy link:', err);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,259 +1,262 @@
|
||||||
<div class="flex flex-col md:flex-row">
|
<div class="flex flex-col md:flex-row">
|
||||||
<!-- Filter Panel for Desktop -->
|
<!-- Filter Panel for Desktop -->
|
||||||
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
||||||
<app-search-modal [isModal]="false"></app-search-modal>
|
<app-search-modal [isModal]="false"></app-search-modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<div class="w-full p-4">
|
<div class="w-full p-4">
|
||||||
<div class="container mx-auto">
|
<div class="container mx-auto">
|
||||||
<!-- Breadcrumbs -->
|
<!-- Breadcrumbs -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- SEO-optimized heading -->
|
<!-- SEO-optimized heading -->
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Businesses for Sale</h1>
|
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Businesses for Sale</h1>
|
||||||
<p class="text-lg text-neutral-600">Discover profitable business opportunities across the United States. Browse
|
<p class="text-lg text-neutral-600">Discover profitable business opportunities across the United States. Browse
|
||||||
verified listings from business owners and brokers.</p>
|
verified listings from business owners and brokers.</p>
|
||||||
</div>
|
<div class="mt-4 text-base text-neutral-700 max-w-4xl">
|
||||||
|
<p>BizMatch features thousands of businesses for sale across all industries and price ranges. Browse restaurants, retail stores, franchises, service businesses, e-commerce operations, and manufacturing companies. Each listing includes financial details, years established, location information, and seller contact details. Our marketplace connects business buyers with sellers and brokers nationwide, making it easy to find your next business opportunity.</p>
|
||||||
<!-- Loading Skeleton -->
|
</div>
|
||||||
@if(isLoading) {
|
</div>
|
||||||
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Loading Business Listings...</h2>
|
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
<!-- Loading Skeleton -->
|
||||||
@for (item of [1,2,3,4,5,6]; track item) {
|
@if(isLoading) {
|
||||||
<div class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden">
|
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Loading Business Listings...</h2>
|
||||||
<div class="p-6 animate-pulse">
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
<!-- Category icon and text -->
|
@for (item of [1,2,3,4,5,6]; track item) {
|
||||||
<div class="flex items-center mb-4">
|
<div class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden">
|
||||||
<div class="w-5 h-5 bg-neutral-200 rounded mr-2"></div>
|
<div class="p-6 animate-pulse">
|
||||||
<div class="h-5 bg-neutral-200 rounded w-32"></div>
|
<!-- Category icon and text -->
|
||||||
</div>
|
<div class="flex items-center mb-4">
|
||||||
<!-- Title -->
|
<div class="w-5 h-5 bg-neutral-200 rounded mr-2"></div>
|
||||||
<div class="h-7 bg-neutral-200 rounded w-3/4 mb-4"></div>
|
<div class="h-5 bg-neutral-200 rounded w-32"></div>
|
||||||
<!-- Badges -->
|
</div>
|
||||||
<div class="flex justify-between mb-4">
|
<!-- Title -->
|
||||||
<div class="h-6 bg-neutral-200 rounded-full w-20"></div>
|
<div class="h-7 bg-neutral-200 rounded w-3/4 mb-4"></div>
|
||||||
<div class="h-6 bg-neutral-200 rounded-full w-16"></div>
|
<!-- Badges -->
|
||||||
</div>
|
<div class="flex justify-between mb-4">
|
||||||
<!-- Details -->
|
<div class="h-6 bg-neutral-200 rounded-full w-20"></div>
|
||||||
<div class="space-y-2 mb-4">
|
<div class="h-6 bg-neutral-200 rounded-full w-16"></div>
|
||||||
<div class="h-4 bg-neutral-200 rounded w-full"></div>
|
</div>
|
||||||
<div class="h-4 bg-neutral-200 rounded w-5/6"></div>
|
<!-- Details -->
|
||||||
<div class="h-4 bg-neutral-200 rounded w-4/6"></div>
|
<div class="space-y-2 mb-4">
|
||||||
<div class="h-4 bg-neutral-200 rounded w-3/4"></div>
|
<div class="h-4 bg-neutral-200 rounded w-full"></div>
|
||||||
<div class="h-4 bg-neutral-200 rounded w-2/3"></div>
|
<div class="h-4 bg-neutral-200 rounded w-5/6"></div>
|
||||||
</div>
|
<div class="h-4 bg-neutral-200 rounded w-4/6"></div>
|
||||||
<!-- Button -->
|
<div class="h-4 bg-neutral-200 rounded w-3/4"></div>
|
||||||
<div class="h-12 bg-neutral-200 rounded-full w-full mt-4"></div>
|
<div class="h-4 bg-neutral-200 rounded w-2/3"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- Button -->
|
||||||
}
|
<div class="h-12 bg-neutral-200 rounded-full w-full mt-4"></div>
|
||||||
</div>
|
</div>
|
||||||
} @else if(listings?.length > 0) {
|
</div>
|
||||||
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Available Business Listings</h2>
|
}
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
</div>
|
||||||
@for (listing of listings; track listing.id) {
|
} @else if(listings?.length > 0) {
|
||||||
<div
|
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Available Business Listings</h2>
|
||||||
class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden hover:shadow-2xl transition-all duration-300 hover:scale-[1.02] group">
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
<div class="p-6 flex flex-col h-full relative z-[0]">
|
@for (listing of listings; track listing.id) {
|
||||||
<!-- Quick Actions Overlay -->
|
<div
|
||||||
<div
|
class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden hover:shadow-2xl transition-all duration-300 hover:scale-[1.02] group">
|
||||||
class="absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-20">
|
<div class="p-6 flex flex-col h-full relative z-[0]">
|
||||||
@if(user) {
|
<!-- Quick Actions Overlay -->
|
||||||
<button class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
<div
|
||||||
[class.bg-red-50]="isFavorite(listing)"
|
class="absolute top-4 right-4 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-20">
|
||||||
[title]="isFavorite(listing) ? 'Remove from favorites' : 'Save to favorites'"
|
@if(user) {
|
||||||
(click)="toggleFavorite($event, listing)">
|
<button class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
||||||
<i
|
[class.bg-red-50]="isFavorite(listing)"
|
||||||
[class]="isFavorite(listing) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
[title]="isFavorite(listing) ? 'Remove from favorites' : 'Save to favorites'"
|
||||||
</button>
|
(click)="toggleFavorite($event, listing)">
|
||||||
}
|
<i
|
||||||
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
[class]="isFavorite(listing) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
||||||
title="Share listing" (click)="shareListing($event, listing)">
|
</button>
|
||||||
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
}
|
||||||
</button>
|
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
||||||
</div>
|
title="Share listing" (click)="shareListing($event, listing)">
|
||||||
|
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
||||||
<div class="flex items-center mb-4">
|
</button>
|
||||||
<i [class]="selectOptions.getIconAndTextColorType(listing.type)" class="mr-2 text-xl"></i>
|
</div>
|
||||||
<span [class]="selectOptions.getTextColorType(listing.type)" class="font-bold text-lg">{{
|
|
||||||
selectOptions.getBusiness(listing.type) }}</span>
|
<div class="flex items-center mb-4">
|
||||||
</div>
|
<i [class]="selectOptions.getIconAndTextColorType(listing.type)" class="mr-2 text-xl"></i>
|
||||||
<h2 class="text-xl font-semibold mb-4">
|
<span [class]="selectOptions.getTextColorType(listing.type)" class="font-bold text-lg">{{
|
||||||
{{ listing.title }}
|
selectOptions.getBusiness(listing.type) }}</span>
|
||||||
@if(listing.draft) {
|
</div>
|
||||||
<span
|
<h2 class="text-xl font-semibold mb-4">
|
||||||
class="bg-amber-100 text-amber-800 border border-amber-300 text-sm font-medium me-2 ml-2 px-2.5 py-0.5 rounded">Draft</span>
|
{{ listing.title }}
|
||||||
}
|
@if(listing.draft) {
|
||||||
</h2>
|
<span
|
||||||
<div class="flex justify-between">
|
class="bg-amber-100 text-amber-800 border border-amber-300 text-sm font-medium me-2 ml-2 px-2.5 py-0.5 rounded">Draft</span>
|
||||||
<span
|
}
|
||||||
class="w-fit inline-flex items-center justify-center px-2 py-1 mb-4 text-xs font-bold leading-none bg-neutral-200 text-neutral-700 rounded-full">
|
</h2>
|
||||||
{{ selectOptions.getState(listing.location.state) }}
|
<div class="flex justify-between">
|
||||||
</span>
|
<span
|
||||||
|
class="w-fit inline-flex items-center justify-center px-2 py-1 mb-4 text-xs font-bold leading-none bg-neutral-200 text-neutral-700 rounded-full">
|
||||||
@if (getListingBadge(listing); as badge) {
|
{{ selectOptions.getState(listing.location.state) }}
|
||||||
<span
|
</span>
|
||||||
class="mb-4 h-fit inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none rounded-full border"
|
|
||||||
[ngClass]="{
|
@if (getListingBadge(listing); as badge) {
|
||||||
'bg-emerald-100 text-emerald-800 border-emerald-300': badge === 'NEW',
|
<span
|
||||||
'bg-teal-100 text-teal-800 border-teal-300': badge === 'UPDATED'
|
class="mb-4 h-fit inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none rounded-full border"
|
||||||
}">
|
[ngClass]="{
|
||||||
{{ badge }}
|
'bg-emerald-100 text-emerald-800 border-emerald-300': badge === 'NEW',
|
||||||
</span>
|
'bg-teal-100 text-teal-800 border-teal-300': badge === 'UPDATED'
|
||||||
}
|
}">
|
||||||
</div>
|
{{ badge }}
|
||||||
|
</span>
|
||||||
<p class="text-base font-bold text-neutral-800 mb-2">
|
}
|
||||||
<strong>Asking price:</strong>
|
</div>
|
||||||
<span class="text-success-600">
|
|
||||||
{{ listing?.price != null ? (listing.price | currency : 'USD' : 'symbol' : '1.0-0') : 'undisclosed' }}
|
<p class="text-base font-bold text-neutral-800 mb-2">
|
||||||
</span>
|
<strong>Asking price:</strong>
|
||||||
</p>
|
<span class="text-success-600">
|
||||||
<p class="text-sm text-neutral-600 mb-2">
|
{{ listing?.price != null ? (listing.price | currency : 'USD' : 'symbol' : '1.0-0') : 'undisclosed' }}
|
||||||
<strong>Sales revenue:</strong>
|
</span>
|
||||||
{{ listing?.salesRevenue != null ? (listing.salesRevenue | currency : 'USD' : 'symbol' : '1.0-0') :
|
</p>
|
||||||
'undisclosed' }}
|
<p class="text-sm text-neutral-600 mb-2">
|
||||||
</p>
|
<strong>Sales revenue:</strong>
|
||||||
<p class="text-sm text-neutral-600 mb-2">
|
{{ listing?.salesRevenue != null ? (listing.salesRevenue | currency : 'USD' : 'symbol' : '1.0-0') :
|
||||||
<strong>Net profit:</strong>
|
'undisclosed' }}
|
||||||
{{ listing?.cashFlow != null ? (listing.cashFlow | currency : 'USD' : 'symbol' : '1.0-0') : 'undisclosed'
|
</p>
|
||||||
}}
|
<p class="text-sm text-neutral-600 mb-2">
|
||||||
</p>
|
<strong>Net profit:</strong>
|
||||||
<p class="text-sm text-neutral-600 mb-2">
|
{{ listing?.cashFlow != null ? (listing.cashFlow | currency : 'USD' : 'symbol' : '1.0-0') : 'undisclosed'
|
||||||
<strong>Location:</strong> {{ listing.location.name ? listing.location.name : listing.location.county ?
|
}}
|
||||||
listing.location.county : this.selectOptions.getState(listing.location.state) }}
|
</p>
|
||||||
</p>
|
<p class="text-sm text-neutral-600 mb-2">
|
||||||
<p class="text-sm text-neutral-600 mb-4"><strong>Years established:</strong> {{ listing.established }}</p>
|
<strong>Location:</strong> {{ listing.location.name ? listing.location.name : listing.location.county ?
|
||||||
@if(listing.imageName) {
|
listing.location.county : this.selectOptions.getState(listing.location.state) }}
|
||||||
<img [appLazyLoad]="env.imageBaseUrl + '/pictures/logo/' + listing.imageName + '.avif?_ts=' + ts"
|
</p>
|
||||||
[alt]="altText.generateListingCardLogoAlt(listing)"
|
<p class="text-sm text-neutral-600 mb-4"><strong>Years established:</strong> {{ listing.established }}</p>
|
||||||
class="absolute bottom-[80px] right-[20px] h-[45px] w-auto" width="100" height="45" />
|
@if(listing.imageName) {
|
||||||
}
|
<img [appLazyLoad]="env.imageBaseUrl + '/pictures/logo/' + listing.imageName + '.avif?_ts=' + ts"
|
||||||
<div class="flex-grow"></div>
|
[alt]="altText.generateListingCardLogoAlt(listing)"
|
||||||
<button
|
class="absolute bottom-[80px] right-[20px] h-[45px] w-auto" width="100" height="45" />
|
||||||
class="bg-success-600 text-white px-5 py-3 rounded-full w-full flex items-center justify-center mt-4 transition-all duration-200 hover:bg-success-700 hover:shadow-lg group/btn"
|
}
|
||||||
[routerLink]="['/business', listing.slug || listing.id]">
|
<div class="flex-grow"></div>
|
||||||
<span class="font-semibold">View Opportunity</span>
|
<button
|
||||||
<i class="fas fa-arrow-right ml-2 group-hover/btn:translate-x-1 transition-transform duration-200"></i>
|
class="bg-success-600 text-white px-5 py-3 rounded-full w-full flex items-center justify-center mt-4 transition-all duration-200 hover:bg-success-700 hover:shadow-lg group/btn"
|
||||||
</button>
|
[routerLink]="['/business', listing.slug || listing.id]">
|
||||||
</div>
|
<span class="font-semibold">View Opportunity</span>
|
||||||
</div>
|
<i class="fas fa-arrow-right ml-2 group-hover/btn:translate-x-1 transition-transform duration-200"></i>
|
||||||
}
|
</button>
|
||||||
</div>
|
</div>
|
||||||
} @else if (listings?.length === 0) {
|
</div>
|
||||||
<div class="w-full flex items-center flex-wrap justify-center gap-10 py-12">
|
}
|
||||||
<div class="grid gap-6 max-w-2xl w-full">
|
</div>
|
||||||
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161"
|
} @else if (listings?.length === 0) {
|
||||||
fill="none">
|
<div class="w-full flex items-center flex-wrap justify-center gap-10 py-12">
|
||||||
<path
|
<div class="grid gap-6 max-w-2xl w-full">
|
||||||
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161"
|
||||||
fill="#EEF2FF" />
|
fill="none">
|
||||||
<path
|
<path
|
||||||
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
||||||
fill="white" stroke="#E5E7EB" />
|
fill="#EEF2FF" />
|
||||||
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
<path
|
||||||
<path
|
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
||||||
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
fill="white" stroke="#E5E7EB" />
|
||||||
stroke="#E5E7EB" />
|
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
||||||
<path
|
<path
|
||||||
d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z"
|
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
||||||
stroke="#E5E7EB" />
|
stroke="#E5E7EB" />
|
||||||
<path
|
<path
|
||||||
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z"
|
||||||
fill="#A5B4FC" stroke="#818CF8" />
|
stroke="#E5E7EB" />
|
||||||
<path
|
<path
|
||||||
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 86.0305 82.0027 83.3821 77.9987 83.3821C77.9987 83.3821 77.9987 86.0305 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
||||||
fill="#4F46E5" />
|
fill="#A5B4FC" stroke="#818CF8" />
|
||||||
<path
|
<path
|
||||||
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 86.0305 82.0027 83.3821 77.9987 83.3821C77.9987 83.3821 77.9987 86.0305 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
||||||
fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<path
|
<path
|
||||||
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
||||||
fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
<path
|
||||||
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
||||||
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
fill="#4F46E5" />
|
||||||
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
||||||
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
</svg>
|
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<div class="text-center">
|
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<h2 class="text-black text-2xl font-semibold leading-loose pb-2">No listings found</h2>
|
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<p class="text-neutral-600 text-base font-normal leading-relaxed pb-6">We couldn't find any businesses
|
</svg>
|
||||||
matching your criteria.<br />Try adjusting your filters or explore popular categories below.</p>
|
<div class="text-center">
|
||||||
|
<h2 class="text-black text-2xl font-semibold leading-loose pb-2">No listings found</h2>
|
||||||
<!-- Action Buttons -->
|
<p class="text-neutral-600 text-base font-normal leading-relaxed pb-6">We couldn't find any businesses
|
||||||
<div class="flex flex-col sm:flex-row gap-3 justify-center mb-8">
|
matching your criteria.<br />Try adjusting your filters or explore popular categories below.</p>
|
||||||
<button (click)="clearAllFilters()"
|
|
||||||
class="px-6 py-3 rounded-full bg-primary-600 text-white text-sm font-semibold hover:bg-primary-700 transition-colors">
|
<!-- Action Buttons -->
|
||||||
<i class="fas fa-redo mr-2"></i>Clear All Filters
|
<div class="flex flex-col sm:flex-row gap-3 justify-center mb-8">
|
||||||
</button>
|
<button (click)="clearAllFilters()"
|
||||||
<button [routerLink]="['/home']"
|
class="px-6 py-3 rounded-full bg-primary-600 text-white text-sm font-semibold hover:bg-primary-700 transition-colors">
|
||||||
class="px-6 py-3 rounded-full border-2 border-neutral-300 text-neutral-700 text-sm font-semibold hover:border-primary-600 hover:text-primary-600 transition-colors">
|
<i class="fas fa-redo mr-2"></i>Clear All Filters
|
||||||
<i class="fas fa-home mr-2"></i>Back to Home
|
</button>
|
||||||
</button>
|
<button [routerLink]="['/home']"
|
||||||
</div>
|
class="px-6 py-3 rounded-full border-2 border-neutral-300 text-neutral-700 text-sm font-semibold hover:border-primary-600 hover:text-primary-600 transition-colors">
|
||||||
|
<i class="fas fa-home mr-2"></i>Back to Home
|
||||||
<!-- Popular Categories Suggestions -->
|
</button>
|
||||||
<div class="mt-8 p-6 bg-neutral-50 rounded-lg">
|
</div>
|
||||||
<h3 class="text-lg font-semibold text-neutral-800 mb-4">
|
|
||||||
<i class="fas fa-fire text-orange-500 mr-2"></i>Popular Categories
|
<!-- Popular Categories Suggestions -->
|
||||||
</h3>
|
<div class="mt-8 p-6 bg-neutral-50 rounded-lg">
|
||||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-3">
|
<h3 class="text-lg font-semibold text-neutral-800 mb-4">
|
||||||
<button (click)="filterByCategory('foodAndRestaurant')"
|
<i class="fas fa-fire text-orange-500 mr-2"></i>Popular Categories
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
</h3>
|
||||||
<i class="fas fa-utensils mr-2"></i>Restaurants
|
<div class="grid grid-cols-2 md:grid-cols-3 gap-3">
|
||||||
</button>
|
<button (click)="filterByCategory('foodAndRestaurant')"
|
||||||
<button (click)="filterByCategory('retail')"
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
<i class="fas fa-utensils mr-2"></i>Restaurants
|
||||||
<i class="fas fa-store mr-2"></i>Retail
|
</button>
|
||||||
</button>
|
<button (click)="filterByCategory('retail')"
|
||||||
<button (click)="filterByCategory('realEstate')"
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
<i class="fas fa-store mr-2"></i>Retail
|
||||||
<i class="fas fa-building mr-2"></i>Real Estate
|
</button>
|
||||||
</button>
|
<button (click)="filterByCategory('realEstate')"
|
||||||
<button (click)="filterByCategory('service')"
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
<i class="fas fa-building mr-2"></i>Real Estate
|
||||||
<i class="fas fa-cut mr-2"></i>Services
|
</button>
|
||||||
</button>
|
<button (click)="filterByCategory('service')"
|
||||||
<button (click)="filterByCategory('franchise')"
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
<i class="fas fa-cut mr-2"></i>Services
|
||||||
<i class="fas fa-handshake mr-2"></i>Franchise
|
</button>
|
||||||
</button>
|
<button (click)="filterByCategory('franchise')"
|
||||||
<button (click)="filterByCategory('professional')"
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
<i class="fas fa-handshake mr-2"></i>Franchise
|
||||||
<i class="fas fa-briefcase mr-2"></i>Professional
|
</button>
|
||||||
</button>
|
<button (click)="filterByCategory('professional')"
|
||||||
</div>
|
class="px-4 py-2 bg-white rounded-lg border border-neutral-200 hover:border-primary-500 hover:bg-primary-50 text-sm text-neutral-700 hover:text-primary-600 transition-all">
|
||||||
</div>
|
<i class="fas fa-briefcase mr-2"></i>Professional
|
||||||
|
</button>
|
||||||
<!-- Helpful Tips -->
|
</div>
|
||||||
<div class="mt-6 p-4 bg-primary-50 border border-primary-100 rounded-lg text-left">
|
</div>
|
||||||
<h4 class="font-semibold text-primary-900 mb-2 flex items-center">
|
|
||||||
<i class="fas fa-lightbulb mr-2"></i>Search Tips
|
<!-- Helpful Tips -->
|
||||||
</h4>
|
<div class="mt-6 p-4 bg-primary-50 border border-primary-100 rounded-lg text-left">
|
||||||
<ul class="text-sm text-primary-800 space-y-1">
|
<h4 class="font-semibold text-primary-900 mb-2 flex items-center">
|
||||||
<li>• Try expanding your search radius</li>
|
<i class="fas fa-lightbulb mr-2"></i>Search Tips
|
||||||
<li>• Consider adjusting your price range</li>
|
</h4>
|
||||||
<li>• Browse all categories to discover opportunities</li>
|
<ul class="text-sm text-primary-800 space-y-1">
|
||||||
</ul>
|
<li>• Try expanding your search radius</li>
|
||||||
</div>
|
<li>• Consider adjusting your price range</li>
|
||||||
</div>
|
<li>• Browse all categories to discover opportunities</li>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if(pageCount > 1) {
|
</div>
|
||||||
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
}
|
||||||
}
|
</div>
|
||||||
</div>
|
@if(pageCount > 1) {
|
||||||
|
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
||||||
<!-- Filter Button for Mobile -->
|
}
|
||||||
<button (click)="openFilterModal()"
|
</div>
|
||||||
class="md:hidden fixed bottom-4 right-4 bg-primary-500 text-white p-3 rounded-full shadow-lg z-20"><i
|
|
||||||
class="fas fa-filter"></i> Filter</button>
|
<!-- Filter Button for Mobile -->
|
||||||
|
<button (click)="openFilterModal()"
|
||||||
|
class="md:hidden fixed bottom-4 right-4 bg-primary-500 text-white p-3 rounded-full shadow-lg z-20"><i
|
||||||
|
class="fas fa-filter"></i> Filter</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,330 +1,331 @@
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||||
import { UntilDestroy } from '@ngneat/until-destroy';
|
import { UntilDestroy } from '@ngneat/until-destroy';
|
||||||
import { Subject, takeUntil } from 'rxjs';
|
import { Subject, takeUntil } from 'rxjs';
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { BusinessListing, SortByOptions } from '../../../../../../bizmatch-server/src/models/db.model';
|
import { BusinessListing, SortByOptions } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||||
import { BusinessListingCriteria, KeycloakUser, LISTINGS_PER_PAGE, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
import { BusinessListingCriteria, KeycloakUser, LISTINGS_PER_PAGE, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
||||||
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
||||||
import { ModalService } from '../../../components/search-modal/modal.service';
|
import { ModalService } from '../../../components/search-modal/modal.service';
|
||||||
import { SearchModalComponent } from '../../../components/search-modal/search-modal.component';
|
import { SearchModalComponent } from '../../../components/search-modal/search-modal.component';
|
||||||
import { LazyLoadImageDirective } from '../../../directives/lazy-load-image.directive';
|
import { LazyLoadImageDirective } from '../../../directives/lazy-load-image.directive';
|
||||||
import { AltTextService } from '../../../services/alt-text.service';
|
import { AltTextService } from '../../../services/alt-text.service';
|
||||||
import { AuthService } from '../../../services/auth.service';
|
import { AuthService } from '../../../services/auth.service';
|
||||||
import { FilterStateService } from '../../../services/filter-state.service';
|
import { FilterStateService } from '../../../services/filter-state.service';
|
||||||
import { ImageService } from '../../../services/image.service';
|
import { ImageService } from '../../../services/image.service';
|
||||||
import { ListingsService } from '../../../services/listings.service';
|
import { ListingsService } from '../../../services/listings.service';
|
||||||
import { SearchService } from '../../../services/search.service';
|
import { SearchService } from '../../../services/search.service';
|
||||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||||
import { SeoService } from '../../../services/seo.service';
|
import { SeoService } from '../../../services/seo.service';
|
||||||
import { map2User } from '../../../utils/utils';
|
import { map2User } from '../../../utils/utils';
|
||||||
|
|
||||||
@UntilDestroy()
|
@UntilDestroy()
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-business-listings',
|
selector: 'app-business-listings',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, SearchModalComponent, LazyLoadImageDirective, BreadcrumbsComponent],
|
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, SearchModalComponent, LazyLoadImageDirective, BreadcrumbsComponent],
|
||||||
templateUrl: './business-listings.component.html',
|
templateUrl: './business-listings.component.html',
|
||||||
styleUrls: ['./business-listings.component.scss', '../../pages.scss'],
|
styleUrls: ['./business-listings.component.scss', '../../pages.scss'],
|
||||||
})
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
export class BusinessListingsComponent implements OnInit, OnDestroy {
|
})
|
||||||
private destroy$ = new Subject<void>();
|
export class BusinessListingsComponent implements OnInit, OnDestroy {
|
||||||
|
private destroy$ = new Subject<void>();
|
||||||
// Component properties
|
|
||||||
environment = environment;
|
// Component properties
|
||||||
env = environment;
|
environment = environment;
|
||||||
listings: Array<BusinessListing> = [];
|
env = environment;
|
||||||
filteredListings: Array<ListingType> = [];
|
listings: Array<BusinessListing> = [];
|
||||||
criteria: BusinessListingCriteria;
|
filteredListings: Array<ListingType> = [];
|
||||||
sortBy: SortByOptions | null = null;
|
criteria: BusinessListingCriteria;
|
||||||
|
sortBy: SortByOptions | null = null;
|
||||||
// Pagination
|
|
||||||
totalRecords = 0;
|
// Pagination
|
||||||
page = 1;
|
totalRecords = 0;
|
||||||
pageCount = 1;
|
page = 1;
|
||||||
first = 0;
|
pageCount = 1;
|
||||||
rows = LISTINGS_PER_PAGE;
|
first = 0;
|
||||||
|
rows = LISTINGS_PER_PAGE;
|
||||||
// UI state
|
|
||||||
ts = new Date().getTime();
|
// UI state
|
||||||
emailToDirName = emailToDirName;
|
ts = new Date().getTime();
|
||||||
isLoading = false;
|
emailToDirName = emailToDirName;
|
||||||
|
isLoading = false;
|
||||||
// Breadcrumbs
|
|
||||||
breadcrumbs: BreadcrumbItem[] = [
|
// Breadcrumbs
|
||||||
{ label: 'Home', url: '/', icon: 'fas fa-home' },
|
breadcrumbs: BreadcrumbItem[] = [
|
||||||
{ label: 'Business Listings' }
|
{ label: 'Home', url: '/', icon: 'fas fa-home' },
|
||||||
];
|
{ label: 'Business Listings' }
|
||||||
|
];
|
||||||
// User for favorites
|
|
||||||
user: KeycloakUser | null = null;
|
// User for favorites
|
||||||
|
user: KeycloakUser | null = null;
|
||||||
constructor(
|
|
||||||
public altText: AltTextService,
|
constructor(
|
||||||
public selectOptions: SelectOptionsService,
|
public altText: AltTextService,
|
||||||
private listingsService: ListingsService,
|
public selectOptions: SelectOptionsService,
|
||||||
private router: Router,
|
private listingsService: ListingsService,
|
||||||
private cdRef: ChangeDetectorRef,
|
private router: Router,
|
||||||
private imageService: ImageService,
|
private cdRef: ChangeDetectorRef,
|
||||||
private searchService: SearchService,
|
private imageService: ImageService,
|
||||||
private modalService: ModalService,
|
private searchService: SearchService,
|
||||||
private filterStateService: FilterStateService,
|
private modalService: ModalService,
|
||||||
private route: ActivatedRoute,
|
private filterStateService: FilterStateService,
|
||||||
private seoService: SeoService,
|
private route: ActivatedRoute,
|
||||||
private authService: AuthService,
|
private seoService: SeoService,
|
||||||
) { }
|
private authService: AuthService,
|
||||||
|
) { }
|
||||||
async ngOnInit(): Promise<void> {
|
|
||||||
// Load user for favorites functionality
|
async ngOnInit(): Promise<void> {
|
||||||
const token = await this.authService.getToken();
|
// Load user for favorites functionality
|
||||||
this.user = map2User(token);
|
const token = await this.authService.getToken();
|
||||||
|
this.user = map2User(token);
|
||||||
// Set SEO meta tags for business listings page
|
|
||||||
this.seoService.updateMetaTags({
|
// Set SEO meta tags for business listings page
|
||||||
title: 'Businesses for Sale - Find Profitable Business Opportunities | BizMatch',
|
this.seoService.updateMetaTags({
|
||||||
description: 'Browse thousands of businesses for sale across the United States. Find restaurants, franchises, retail stores, and more. Verified listings from business owners and brokers.',
|
title: 'Businesses for Sale - Profitable Opportunities | BizMatch',
|
||||||
keywords: 'businesses for sale, buy a business, business opportunities, franchise for sale, restaurant for sale, retail business for sale, business broker listings',
|
description: 'Browse thousands of businesses for sale. Find restaurants, franchises, retail stores, and more. Verified listings from owners and brokers.',
|
||||||
type: 'website'
|
keywords: 'businesses for sale, buy a business, business opportunities, franchise for sale, restaurant for sale, retail business for sale, business broker listings',
|
||||||
});
|
type: 'website'
|
||||||
|
});
|
||||||
// Subscribe to state changes
|
|
||||||
this.filterStateService
|
// Subscribe to state changes
|
||||||
.getState$('businessListings')
|
this.filterStateService
|
||||||
.pipe(takeUntil(this.destroy$))
|
.getState$('businessListings')
|
||||||
.subscribe(state => {
|
.pipe(takeUntil(this.destroy$))
|
||||||
this.criteria = state.criteria;
|
.subscribe(state => {
|
||||||
this.sortBy = state.sortBy;
|
this.criteria = state.criteria;
|
||||||
// Automatically search when state changes
|
this.sortBy = state.sortBy;
|
||||||
this.search();
|
// Automatically search when state changes
|
||||||
});
|
this.search();
|
||||||
|
});
|
||||||
// Subscribe to search triggers (if triggered from other components)
|
|
||||||
this.searchService.searchTrigger$.pipe(takeUntil(this.destroy$)).subscribe(type => {
|
// Subscribe to search triggers (if triggered from other components)
|
||||||
if (type === 'businessListings') {
|
this.searchService.searchTrigger$.pipe(takeUntil(this.destroy$)).subscribe(type => {
|
||||||
this.search();
|
if (type === 'businessListings') {
|
||||||
}
|
this.search();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
async search(): Promise<void> {
|
|
||||||
try {
|
async search(): Promise<void> {
|
||||||
// Show loading state
|
try {
|
||||||
this.isLoading = true;
|
// Show loading state
|
||||||
|
this.isLoading = true;
|
||||||
// Get current criteria from service
|
|
||||||
this.criteria = this.filterStateService.getCriteria('businessListings') as BusinessListingCriteria;
|
// Get current criteria from service
|
||||||
|
this.criteria = this.filterStateService.getCriteria('businessListings') as BusinessListingCriteria;
|
||||||
// Add sortBy if available
|
|
||||||
const searchCriteria = {
|
// Add sortBy if available
|
||||||
...this.criteria,
|
const searchCriteria = {
|
||||||
sortBy: this.sortBy,
|
...this.criteria,
|
||||||
};
|
sortBy: this.sortBy,
|
||||||
|
};
|
||||||
// Perform search
|
|
||||||
const listingsResponse = await this.listingsService.getListings('business');
|
// Perform search
|
||||||
this.listings = listingsResponse.results;
|
const listingsResponse = await this.listingsService.getListings('business');
|
||||||
this.totalRecords = listingsResponse.totalCount;
|
this.listings = listingsResponse.results;
|
||||||
this.pageCount = Math.ceil(this.totalRecords / LISTINGS_PER_PAGE);
|
this.totalRecords = listingsResponse.totalCount;
|
||||||
this.page = this.criteria.page || 1;
|
this.pageCount = Math.ceil(this.totalRecords / LISTINGS_PER_PAGE);
|
||||||
|
this.page = this.criteria.page || 1;
|
||||||
// Hide loading state
|
|
||||||
this.isLoading = false;
|
// Hide loading state
|
||||||
|
this.isLoading = false;
|
||||||
// Update pagination SEO links
|
|
||||||
this.updatePaginationSEO();
|
// Update pagination SEO links
|
||||||
|
this.updatePaginationSEO();
|
||||||
// Update view
|
|
||||||
this.cdRef.markForCheck();
|
// Update view
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.markForCheck();
|
||||||
} catch (error) {
|
this.cdRef.detectChanges();
|
||||||
console.error('Search error:', error);
|
} catch (error) {
|
||||||
// Handle error appropriately
|
console.error('Search error:', error);
|
||||||
this.listings = [];
|
// Handle error appropriately
|
||||||
this.totalRecords = 0;
|
this.listings = [];
|
||||||
this.isLoading = false;
|
this.totalRecords = 0;
|
||||||
this.cdRef.markForCheck();
|
this.isLoading = false;
|
||||||
}
|
this.cdRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onPageChange(page: number): void {
|
|
||||||
// Update only pagination properties
|
onPageChange(page: number): void {
|
||||||
this.filterStateService.updateCriteria('businessListings', {
|
// Update only pagination properties
|
||||||
page: page,
|
this.filterStateService.updateCriteria('businessListings', {
|
||||||
start: (page - 1) * LISTINGS_PER_PAGE,
|
page: page,
|
||||||
length: LISTINGS_PER_PAGE,
|
start: (page - 1) * LISTINGS_PER_PAGE,
|
||||||
});
|
length: LISTINGS_PER_PAGE,
|
||||||
// Search will be triggered automatically through state subscription
|
});
|
||||||
}
|
// Search will be triggered automatically through state subscription
|
||||||
|
}
|
||||||
clearAllFilters(): void {
|
|
||||||
// Reset criteria but keep sortBy
|
clearAllFilters(): void {
|
||||||
this.filterStateService.clearFilters('businessListings');
|
// Reset criteria but keep sortBy
|
||||||
// Search will be triggered automatically through state subscription
|
this.filterStateService.clearFilters('businessListings');
|
||||||
}
|
// Search will be triggered automatically through state subscription
|
||||||
|
}
|
||||||
async openFilterModal(): Promise<void> {
|
|
||||||
// Open modal with current criteria
|
async openFilterModal(): Promise<void> {
|
||||||
const currentCriteria = this.filterStateService.getCriteria('businessListings');
|
// Open modal with current criteria
|
||||||
const modalResult = await this.modalService.showModal(currentCriteria);
|
const currentCriteria = this.filterStateService.getCriteria('businessListings');
|
||||||
|
const modalResult = await this.modalService.showModal(currentCriteria);
|
||||||
if (modalResult.accepted) {
|
|
||||||
// Modal accepted changes - state is updated by modal
|
if (modalResult.accepted) {
|
||||||
// Search will be triggered automatically through state subscription
|
// Modal accepted changes - state is updated by modal
|
||||||
} else {
|
// Search will be triggered automatically through state subscription
|
||||||
// Modal was cancelled - no action needed
|
} else {
|
||||||
}
|
// Modal was cancelled - no action needed
|
||||||
}
|
}
|
||||||
|
}
|
||||||
getListingPrice(listing: BusinessListing): string {
|
|
||||||
if (!listing.price) return 'Price on Request';
|
getListingPrice(listing: BusinessListing): string {
|
||||||
return `$${listing.price.toLocaleString()}`;
|
if (!listing.price) return 'Price on Request';
|
||||||
}
|
return `$${listing.price.toLocaleString()}`;
|
||||||
|
}
|
||||||
getListingLocation(listing: BusinessListing): string {
|
|
||||||
if (!listing.location) return 'Location not specified';
|
getListingLocation(listing: BusinessListing): string {
|
||||||
return `${listing.location.name}, ${listing.location.state}`;
|
if (!listing.location) return 'Location not specified';
|
||||||
}
|
return `${listing.location.name}, ${listing.location.state}`;
|
||||||
private isWithinDays(date: Date | string | undefined | null, days: number): boolean {
|
}
|
||||||
if (!date) return false;
|
private isWithinDays(date: Date | string | undefined | null, days: number): boolean {
|
||||||
return dayjs().diff(dayjs(date), 'day') < days;
|
if (!date) return false;
|
||||||
}
|
return dayjs().diff(dayjs(date), 'day') < days;
|
||||||
|
}
|
||||||
getListingBadge(listing: BusinessListing): 'NEW' | 'UPDATED' | null {
|
|
||||||
if (this.isWithinDays(listing.created, 14)) return 'NEW'; // Priorität
|
getListingBadge(listing: BusinessListing): 'NEW' | 'UPDATED' | null {
|
||||||
if (this.isWithinDays(listing.updated, 14)) return 'UPDATED';
|
if (this.isWithinDays(listing.created, 14)) return 'NEW'; // Priorität
|
||||||
return null;
|
if (this.isWithinDays(listing.updated, 14)) return 'UPDATED';
|
||||||
}
|
return null;
|
||||||
navigateToDetails(listingId: string): void {
|
}
|
||||||
this.router.navigate(['/details-business', listingId]);
|
navigateToDetails(listingId: string): void {
|
||||||
}
|
this.router.navigate(['/details-business', listingId]);
|
||||||
getDaysListed(listing: BusinessListing) {
|
}
|
||||||
return dayjs().diff(listing.created, 'day');
|
getDaysListed(listing: BusinessListing) {
|
||||||
}
|
return dayjs().diff(listing.created, 'day');
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Filter by popular category
|
/**
|
||||||
*/
|
* Filter by popular category
|
||||||
filterByCategory(category: string): void {
|
*/
|
||||||
this.filterStateService.updateCriteria('businessListings', {
|
filterByCategory(category: string): void {
|
||||||
types: [category],
|
this.filterStateService.updateCriteria('businessListings', {
|
||||||
page: 1,
|
types: [category],
|
||||||
start: 0,
|
page: 1,
|
||||||
length: LISTINGS_PER_PAGE,
|
start: 0,
|
||||||
});
|
length: LISTINGS_PER_PAGE,
|
||||||
// Search will be triggered automatically through state subscription
|
});
|
||||||
}
|
// Search will be triggered automatically through state subscription
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Check if listing is already in user's favorites
|
/**
|
||||||
*/
|
* Check if listing is already in user's favorites
|
||||||
isFavorite(listing: BusinessListing): boolean {
|
*/
|
||||||
if (!this.user?.email || !listing.favoritesForUser) return false;
|
isFavorite(listing: BusinessListing): boolean {
|
||||||
return listing.favoritesForUser.includes(this.user.email);
|
if (!this.user?.email || !listing.favoritesForUser) return false;
|
||||||
}
|
return listing.favoritesForUser.includes(this.user.email);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Toggle favorite status for a listing
|
/**
|
||||||
*/
|
* Toggle favorite status for a listing
|
||||||
async toggleFavorite(event: Event, listing: BusinessListing): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async toggleFavorite(event: Event, listing: BusinessListing): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
if (!this.user?.email) {
|
|
||||||
// User not logged in - redirect to login or show message
|
if (!this.user?.email) {
|
||||||
this.router.navigate(['/login']);
|
// User not logged in - redirect to login or show message
|
||||||
return;
|
this.router.navigate(['/login']);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
try {
|
|
||||||
if (this.isFavorite(listing)) {
|
try {
|
||||||
// Remove from favorites
|
if (this.isFavorite(listing)) {
|
||||||
await this.listingsService.removeFavorite(listing.id, 'business');
|
// Remove from favorites
|
||||||
listing.favoritesForUser = listing.favoritesForUser.filter(email => email !== this.user!.email);
|
await this.listingsService.removeFavorite(listing.id, 'business');
|
||||||
} else {
|
listing.favoritesForUser = listing.favoritesForUser.filter(email => email !== this.user!.email);
|
||||||
// Add to favorites
|
} else {
|
||||||
await this.listingsService.addToFavorites(listing.id, 'business');
|
// Add to favorites
|
||||||
if (!listing.favoritesForUser) {
|
await this.listingsService.addToFavorites(listing.id, 'business');
|
||||||
listing.favoritesForUser = [];
|
if (!listing.favoritesForUser) {
|
||||||
}
|
listing.favoritesForUser = [];
|
||||||
listing.favoritesForUser.push(this.user.email);
|
}
|
||||||
}
|
listing.favoritesForUser.push(this.user.email);
|
||||||
this.cdRef.detectChanges();
|
}
|
||||||
} catch (error) {
|
this.cdRef.detectChanges();
|
||||||
console.error('Error toggling favorite:', error);
|
} catch (error) {
|
||||||
}
|
console.error('Error toggling favorite:', error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Share a listing - opens native share dialog or copies to clipboard
|
/**
|
||||||
*/
|
* Share a listing - opens native share dialog or copies to clipboard
|
||||||
async shareListing(event: Event, listing: BusinessListing): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async shareListing(event: Event, listing: BusinessListing): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
const url = `${window.location.origin}/business/${listing.slug || listing.id}`;
|
|
||||||
const title = listing.title || 'Business Listing';
|
const url = `${window.location.origin}/business/${listing.slug || listing.id}`;
|
||||||
|
const title = listing.title || 'Business Listing';
|
||||||
// Try native share API first (works on mobile and some desktop browsers)
|
|
||||||
if (navigator.share) {
|
// Try native share API first (works on mobile and some desktop browsers)
|
||||||
try {
|
if (navigator.share) {
|
||||||
await navigator.share({
|
try {
|
||||||
title: title,
|
await navigator.share({
|
||||||
text: `Check out this business: ${title}`,
|
title: title,
|
||||||
url: url,
|
text: `Check out this business: ${title}`,
|
||||||
});
|
url: url,
|
||||||
} catch (err) {
|
});
|
||||||
// User cancelled or share failed - fall back to clipboard
|
} catch (err) {
|
||||||
this.copyToClipboard(url);
|
// User cancelled or share failed - fall back to clipboard
|
||||||
}
|
this.copyToClipboard(url);
|
||||||
} else {
|
}
|
||||||
// Fallback: open Facebook share dialog
|
} else {
|
||||||
const encodedUrl = encodeURIComponent(url);
|
// Fallback: open Facebook share dialog
|
||||||
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
const encodedUrl = encodeURIComponent(url);
|
||||||
}
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Copy URL to clipboard and show feedback
|
/**
|
||||||
*/
|
* Copy URL to clipboard and show feedback
|
||||||
private copyToClipboard(url: string): void {
|
*/
|
||||||
navigator.clipboard.writeText(url).then(() => {
|
private copyToClipboard(url: string): void {
|
||||||
// Could add a toast notification here
|
navigator.clipboard.writeText(url).then(() => {
|
||||||
console.log('Link copied to clipboard!');
|
// Could add a toast notification here
|
||||||
}).catch(err => {
|
console.log('Link copied to clipboard!');
|
||||||
console.error('Failed to copy link:', err);
|
}).catch(err => {
|
||||||
});
|
console.error('Failed to copy link:', err);
|
||||||
}
|
});
|
||||||
|
}
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.destroy$.next();
|
ngOnDestroy(): void {
|
||||||
this.destroy$.complete();
|
this.destroy$.next();
|
||||||
// Clean up pagination links when leaving the page
|
this.destroy$.complete();
|
||||||
this.seoService.clearPaginationLinks();
|
// Clean up pagination links when leaving the page
|
||||||
}
|
this.seoService.clearPaginationLinks();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Update pagination SEO links (rel="next/prev") and CollectionPage schema
|
/**
|
||||||
*/
|
* Update pagination SEO links (rel="next/prev") and CollectionPage schema
|
||||||
private updatePaginationSEO(): void {
|
*/
|
||||||
const baseUrl = `${this.seoService.getBaseUrl()}/businessListings`;
|
private updatePaginationSEO(): void {
|
||||||
|
const baseUrl = `${this.seoService.getBaseUrl()}/businessListings`;
|
||||||
// Inject rel="next" and rel="prev" links
|
|
||||||
this.seoService.injectPaginationLinks(baseUrl, this.page, this.pageCount);
|
// Inject rel="next" and rel="prev" links
|
||||||
|
this.seoService.injectPaginationLinks(baseUrl, this.page, this.pageCount);
|
||||||
// Inject CollectionPage schema for paginated results
|
|
||||||
const collectionSchema = this.seoService.generateCollectionPageSchema({
|
// Inject CollectionPage schema for paginated results
|
||||||
name: 'Businesses for Sale',
|
const collectionSchema = this.seoService.generateCollectionPageSchema({
|
||||||
description: 'Browse thousands of businesses for sale across the United States. Find restaurants, franchises, retail stores, and more.',
|
name: 'Businesses for Sale',
|
||||||
totalItems: this.totalRecords,
|
description: 'Browse thousands of businesses for sale across the United States. Find restaurants, franchises, retail stores, and more.',
|
||||||
itemsPerPage: LISTINGS_PER_PAGE,
|
totalItems: this.totalRecords,
|
||||||
currentPage: this.page,
|
itemsPerPage: LISTINGS_PER_PAGE,
|
||||||
baseUrl: baseUrl
|
currentPage: this.page,
|
||||||
});
|
baseUrl: baseUrl
|
||||||
this.seoService.injectStructuredData(collectionSchema);
|
});
|
||||||
}
|
this.seoService.injectStructuredData(collectionSchema);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,143 +1,146 @@
|
||||||
<div class="flex flex-col md:flex-row">
|
<div class="flex flex-col md:flex-row">
|
||||||
<!-- Filter Panel for Desktop -->
|
<!-- Filter Panel for Desktop -->
|
||||||
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
<div class="hidden md:block w-full md:w-1/4 h-full bg-white shadow-lg p-6 overflow-y-auto z-10">
|
||||||
<app-search-modal-commercial [isModal]="false"></app-search-modal-commercial>
|
<app-search-modal-commercial [isModal]="false"></app-search-modal-commercial>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<div class="w-full p-4">
|
<div class="w-full p-4">
|
||||||
<div class="container mx-auto">
|
<div class="container mx-auto">
|
||||||
<!-- Breadcrumbs -->
|
<!-- Breadcrumbs -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
<app-breadcrumbs [breadcrumbs]="breadcrumbs"></app-breadcrumbs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- SEO-optimized heading -->
|
<!-- SEO-optimized heading -->
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Commercial Properties for Sale</h1>
|
<h1 class="text-3xl md:text-4xl font-bold text-neutral-900 mb-2">Commercial Properties for Sale</h1>
|
||||||
<p class="text-lg text-neutral-600">Find office buildings, retail spaces, warehouses, and industrial properties across the United States. Investment opportunities from verified sellers and commercial real estate brokers.</p>
|
<p class="text-lg text-neutral-600">Find office buildings, retail spaces, warehouses, and industrial properties across the United States. Investment opportunities from verified sellers and commercial real estate brokers.</p>
|
||||||
</div>
|
<div class="mt-4 text-base text-neutral-700 max-w-4xl">
|
||||||
|
<p>BizMatch showcases commercial real estate listings including office buildings, retail spaces, warehouses, and industrial properties for sale or lease. Browse investment properties across the United States with detailed information on square footage, zoning, pricing, and location. Our platform connects property buyers and investors with sellers and commercial real estate brokers. Find shopping centers, medical buildings, land parcels, and mixed-use developments in your target market.</p>
|
||||||
@if(listings?.length > 0) {
|
</div>
|
||||||
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Available Commercial Property Listings</h2>
|
</div>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
@for (listing of listings; track listing.id) {
|
@if(listings?.length > 0) {
|
||||||
<div class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden flex flex-col h-full group relative">
|
<h2 class="text-2xl font-semibold text-neutral-800 mb-4">Available Commercial Property Listings</h2>
|
||||||
<!-- Quick Actions Overlay -->
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
<div class="absolute top-4 right-4 z-10 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
@for (listing of listings; track listing.id) {
|
||||||
@if(user) {
|
<div class="bg-white rounded-lg drop-shadow-custom-bg-mobile md:drop-shadow-custom-bg overflow-hidden flex flex-col h-full group relative">
|
||||||
<button
|
<!-- Quick Actions Overlay -->
|
||||||
class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
<div class="absolute top-4 right-4 z-10 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
||||||
[class.bg-red-50]="isFavorite(listing)"
|
@if(user) {
|
||||||
[class.opacity-100]="isFavorite(listing)"
|
<button
|
||||||
[title]="isFavorite(listing) ? 'Remove from favorites' : 'Save to favorites'"
|
class="bg-white rounded-full p-2 shadow-lg transition-colors"
|
||||||
(click)="toggleFavorite($event, listing)">
|
[class.bg-red-50]="isFavorite(listing)"
|
||||||
<i [class]="isFavorite(listing) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
[class.opacity-100]="isFavorite(listing)"
|
||||||
</button>
|
[title]="isFavorite(listing) ? 'Remove from favorites' : 'Save to favorites'"
|
||||||
}
|
(click)="toggleFavorite($event, listing)">
|
||||||
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
<i [class]="isFavorite(listing) ? 'fas fa-heart text-red-500' : 'far fa-heart text-red-500 hover:scale-110 transition-transform'"></i>
|
||||||
title="Share property" (click)="shareProperty($event, listing)">
|
</button>
|
||||||
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
}
|
||||||
</button>
|
<button type="button" class="bg-white rounded-full p-2 shadow-lg hover:bg-blue-50 transition-colors"
|
||||||
</div>
|
title="Share property" (click)="shareProperty($event, listing)">
|
||||||
@if (listing.imageOrder?.length>0){
|
<i class="fas fa-share-alt text-blue-500 hover:scale-110 transition-transform"></i>
|
||||||
<img [appLazyLoad]="env.imageBaseUrl + '/pictures/property/' + listing.imagePath + '/' + listing.serialId + '/' + listing.imageOrder[0]"
|
</button>
|
||||||
[alt]="altText.generatePropertyListingAlt(listing)"
|
</div>
|
||||||
class="w-full h-48 object-cover"
|
@if (listing.imageOrder?.length>0){
|
||||||
width="400"
|
<img [appLazyLoad]="env.imageBaseUrl + '/pictures/property/' + listing.imagePath + '/' + listing.serialId + '/' + listing.imageOrder[0]"
|
||||||
height="192" />
|
[alt]="altText.generatePropertyListingAlt(listing)"
|
||||||
} @else {
|
class="w-full h-48 object-cover"
|
||||||
<img [appLazyLoad]="'assets/images/placeholder_properties.jpg'"
|
width="400"
|
||||||
[alt]="'Commercial property placeholder - ' + listing.title"
|
height="192" />
|
||||||
class="w-full h-48 object-cover"
|
} @else {
|
||||||
width="400"
|
<img [appLazyLoad]="'assets/images/placeholder_properties.jpg'"
|
||||||
height="192" />
|
[alt]="'Commercial property placeholder - ' + listing.title"
|
||||||
}
|
class="w-full h-48 object-cover"
|
||||||
<div class="p-4 flex flex-col flex-grow">
|
width="400"
|
||||||
<span [class]="selectOptions.getTextColorTypeOfCommercial(listing.type)" class="text-sm font-semibold"
|
height="192" />
|
||||||
><i [class]="selectOptions.getIconAndTextColorTypeOfCommercials(listing.type)" class="mr-1"></i> {{ selectOptions.getCommercialProperty(listing.type) }}</span
|
}
|
||||||
>
|
<div class="p-4 flex flex-col flex-grow">
|
||||||
<div class="flex items-center justify-between my-2">
|
<span [class]="selectOptions.getTextColorTypeOfCommercial(listing.type)" class="text-sm font-semibold"
|
||||||
<span class="bg-neutral-200 text-neutral-700 text-xs font-semibold px-2 py-1 rounded">{{ selectOptions.getState(listing.location.state) }}</span>
|
><i [class]="selectOptions.getIconAndTextColorTypeOfCommercials(listing.type)" class="mr-1"></i> {{ selectOptions.getCommercialProperty(listing.type) }}</span
|
||||||
<p class="text-sm text-neutral-600 mb-4">
|
>
|
||||||
<strong>{{ getDaysListed(listing) }} days listed</strong>
|
<div class="flex items-center justify-between my-2">
|
||||||
</p>
|
<span class="bg-neutral-200 text-neutral-700 text-xs font-semibold px-2 py-1 rounded">{{ selectOptions.getState(listing.location.state) }}</span>
|
||||||
</div>
|
<p class="text-sm text-neutral-600 mb-4">
|
||||||
<h3 class="text-lg font-semibold mb-2">
|
<strong>{{ getDaysListed(listing) }} days listed</strong>
|
||||||
{{ listing.title }}
|
</p>
|
||||||
@if(listing.draft){
|
</div>
|
||||||
<span class="bg-red-100 text-red-800 text-sm font-medium me-2 ml-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">Draft</span>
|
<h3 class="text-lg font-semibold mb-2">
|
||||||
}
|
{{ listing.title }}
|
||||||
</h3>
|
@if(listing.draft){
|
||||||
<p class="text-neutral-600 mb-2">{{ listing.location.name ? listing.location.name : listing.location.county }}</p>
|
<span class="bg-red-100 text-red-800 text-sm font-medium me-2 ml-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">Draft</span>
|
||||||
<p class="text-xl font-bold mb-4">{{ listing.price | currency : 'USD' : 'symbol' : '1.0-0' }}</p>
|
}
|
||||||
<div class="flex-grow"></div>
|
</h3>
|
||||||
<button [routerLink]="['/commercial-property', listing.slug || listing.id]" class="bg-success-500 text-white px-4 py-2 rounded-full w-full hover:bg-success-600 transition duration-300 mt-auto">
|
<p class="text-neutral-600 mb-2">{{ listing.location.name ? listing.location.name : listing.location.county }}</p>
|
||||||
View Full Listing <i class="fas fa-arrow-right ml-1"></i>
|
<p class="text-xl font-bold mb-4">{{ listing.price | currency : 'USD' : 'symbol' : '1.0-0' }}</p>
|
||||||
</button>
|
<div class="flex-grow"></div>
|
||||||
</div>
|
<button [routerLink]="['/commercial-property', listing.slug || listing.id]" class="bg-success-500 text-white px-4 py-2 rounded-full w-full hover:bg-success-600 transition duration-300 mt-auto">
|
||||||
</div>
|
View Full Listing <i class="fas fa-arrow-right ml-1"></i>
|
||||||
}
|
</button>
|
||||||
</div>
|
</div>
|
||||||
} @else if (listings?.length === 0){
|
</div>
|
||||||
<div class="w-full flex items-center flex-wrap justify-center gap-10">
|
}
|
||||||
<div class="grid gap-4 w-60">
|
</div>
|
||||||
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161" fill="none">
|
} @else if (listings?.length === 0){
|
||||||
<path
|
<div class="w-full flex items-center flex-wrap justify-center gap-10">
|
||||||
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
<div class="grid gap-4 w-60">
|
||||||
fill="#EEF2FF"
|
<svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="154" height="161" viewBox="0 0 154 161" fill="none">
|
||||||
/>
|
<path
|
||||||
<path
|
d="M0.0616455 84.4268C0.0616455 42.0213 34.435 7.83765 76.6507 7.83765C118.803 7.83765 153.224 42.0055 153.224 84.4268C153.224 102.42 147.026 118.974 136.622 132.034C122.282 150.138 100.367 161 76.6507 161C52.7759 161 30.9882 150.059 16.6633 132.034C6.25961 118.974 0.0616455 102.42 0.0616455 84.4268Z"
|
||||||
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
fill="#EEF2FF"
|
||||||
fill="white"
|
/>
|
||||||
stroke="#E5E7EB"
|
<path
|
||||||
/>
|
d="M96.8189 0.632498L96.8189 0.632384L96.8083 0.630954C96.2034 0.549581 95.5931 0.5 94.9787 0.5H29.338C22.7112 0.5 17.3394 5.84455 17.3394 12.4473V142.715C17.3394 149.318 22.7112 154.662 29.338 154.662H123.948C130.591 154.662 135.946 149.317 135.946 142.715V38.9309C135.946 38.0244 135.847 37.1334 135.648 36.2586L135.648 36.2584C135.117 33.9309 133.874 31.7686 132.066 30.1333C132.066 30.1331 132.065 30.1329 132.065 30.1327L103.068 3.65203C103.068 3.6519 103.067 3.65177 103.067 3.65164C101.311 2.03526 99.1396 0.995552 96.8189 0.632498Z"
|
||||||
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
fill="white"
|
||||||
<path
|
stroke="#E5E7EB"
|
||||||
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
/>
|
||||||
stroke="#E5E7EB"
|
<ellipse cx="80.0618" cy="81" rx="28.0342" ry="28.0342" fill="#EEF2FF" />
|
||||||
/>
|
<path
|
||||||
<path d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z" stroke="#E5E7EB" />
|
d="M99.2393 61.3061L99.2391 61.3058C88.498 50.5808 71.1092 50.5804 60.3835 61.3061C49.6423 72.0316 49.6422 89.4361 60.3832 100.162C71.109 110.903 88.4982 110.903 99.2393 100.162C109.965 89.4363 109.965 72.0317 99.2393 61.3061ZM105.863 54.6832C120.249 69.0695 120.249 92.3985 105.863 106.785C91.4605 121.171 68.1468 121.171 53.7446 106.785C39.3582 92.3987 39.3582 69.0693 53.7446 54.683C68.1468 40.2965 91.4605 40.2966 105.863 54.6832Z"
|
||||||
<path
|
stroke="#E5E7EB"
|
||||||
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
/>
|
||||||
fill="#A5B4FC"
|
<path d="M110.782 119.267L102.016 110.492C104.888 108.267 107.476 105.651 109.564 102.955L118.329 111.729L110.782 119.267Z" stroke="#E5E7EB" />
|
||||||
stroke="#818CF8"
|
<path
|
||||||
/>
|
d="M139.122 125.781L139.122 125.78L123.313 109.988C123.313 109.987 123.313 109.987 123.312 109.986C121.996 108.653 119.849 108.657 118.521 109.985L118.871 110.335L118.521 109.985L109.047 119.459C107.731 120.775 107.735 122.918 109.044 124.247L109.047 124.249L124.858 140.06C128.789 143.992 135.191 143.992 139.122 140.06C143.069 136.113 143.069 129.728 139.122 125.781Z"
|
||||||
<path
|
fill="#A5B4FC"
|
||||||
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 83.3821 77.9987 83.3821 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
stroke="#818CF8"
|
||||||
fill="#4F46E5"
|
/>
|
||||||
/>
|
<path
|
||||||
<path
|
d="M83.185 87.2285C82.5387 87.2285 82.0027 86.6926 82.0027 86.0305C82.0027 83.3821 77.9987 83.3821 77.9987 86.0305C77.9987 86.6926 77.4627 87.2285 76.8006 87.2285C76.1543 87.2285 75.6183 86.6926 75.6183 86.0305C75.6183 80.2294 84.3831 80.2451 84.3831 86.0305C84.3831 86.6926 83.8471 87.2285 83.185 87.2285Z"
|
||||||
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
fill="#4F46E5"
|
||||||
fill="#4F46E5"
|
/>
|
||||||
/>
|
<path
|
||||||
<path
|
d="M93.3528 77.0926H88.403C87.7409 77.0926 87.2049 76.5567 87.2049 75.8946C87.2049 75.2483 87.7409 74.7123 88.403 74.7123H93.3528C94.0149 74.7123 94.5509 75.2483 94.5509 75.8946C94.5509 76.5567 94.0149 77.0926 93.3528 77.0926Z"
|
||||||
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
fill="#4F46E5"
|
||||||
fill="#4F46E5"
|
/>
|
||||||
/>
|
<path
|
||||||
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
d="M71.5987 77.0925H66.6488C65.9867 77.0925 65.4507 76.5565 65.4507 75.8945C65.4507 75.2481 65.9867 74.7122 66.6488 74.7122H71.5987C72.245 74.7122 72.781 75.2481 72.781 75.8945C72.781 76.5565 72.245 77.0925 71.5987 77.0925Z"
|
||||||
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
fill="#4F46E5"
|
||||||
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
/>
|
||||||
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="21.5128" width="41.0256" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="133.65" width="54.7009" height="5.47009" rx="2.73504" fill="#A5B4FC" />
|
||||||
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
<rect x="38.3522" y="29.7179" width="13.6752" height="2.73504" rx="1.36752" fill="#4F46E5" />
|
||||||
</svg>
|
<circle cx="56.13" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<div>
|
<circle cx="61.6001" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<h2 class="text-center text-black text-xl font-semibold leading-loose pb-2">There’s no listing here</h2>
|
<circle cx="67.0702" cy="31.0854" r="1.36752" fill="#4F46E5" />
|
||||||
<p class="text-center text-black text-base font-normal leading-relaxed pb-4">Try changing your filters to <br />see listings</p>
|
</svg>
|
||||||
<div class="flex gap-3">
|
<div>
|
||||||
<button (click)="clearAllFilters()" class="w-full px-3 py-2 rounded-full border border-neutral-300 text-neutral-900 text-xs font-semibold leading-4">Clear Filter</button>
|
<h2 class="text-center text-black text-xl font-semibold leading-loose pb-2">There’s no listing here</h2>
|
||||||
</div>
|
<p class="text-center text-black text-base font-normal leading-relaxed pb-4">Try changing your filters to <br />see listings</p>
|
||||||
</div>
|
<div class="flex gap-3">
|
||||||
</div>
|
<button (click)="clearAllFilters()" class="w-full px-3 py-2 rounded-full border border-neutral-300 text-neutral-900 text-xs font-semibold leading-4">Clear Filter</button>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if(pageCount > 1) {
|
</div>
|
||||||
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
}
|
||||||
}
|
</div>
|
||||||
</div>
|
@if(pageCount > 1) {
|
||||||
|
<app-paginator [page]="page" [pageCount]="pageCount" (pageChange)="onPageChange($event)"></app-paginator>
|
||||||
<!-- Filter Button for Mobile -->
|
}
|
||||||
<button (click)="openFilterModal()" class="md:hidden fixed bottom-4 right-4 bg-primary-500 text-white p-3 rounded-full shadow-lg z-20"><i class="fas fa-filter"></i> Filter</button>
|
</div>
|
||||||
</div>
|
|
||||||
|
<!-- Filter Button for Mobile -->
|
||||||
|
<button (click)="openFilterModal()" class="md:hidden fixed bottom-4 right-4 bg-primary-500 text-white p-3 rounded-full shadow-lg z-20"><i class="fas fa-filter"></i> Filter</button>
|
||||||
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,301 +1,302 @@
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
||||||
import { UntilDestroy } from '@ngneat/until-destroy';
|
import { UntilDestroy } from '@ngneat/until-destroy';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { Subject, takeUntil } from 'rxjs';
|
import { Subject, takeUntil } from 'rxjs';
|
||||||
import { CommercialPropertyListing, SortByOptions } from '../../../../../../bizmatch-server/src/models/db.model';
|
import { CommercialPropertyListing, SortByOptions } from '../../../../../../bizmatch-server/src/models/db.model';
|
||||||
import { CommercialPropertyListingCriteria, KeycloakUser, LISTINGS_PER_PAGE, ResponseCommercialPropertyListingArray } from '../../../../../../bizmatch-server/src/models/main.model';
|
import { CommercialPropertyListingCriteria, KeycloakUser, LISTINGS_PER_PAGE, ResponseCommercialPropertyListingArray } from '../../../../../../bizmatch-server/src/models/main.model';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
import { BreadcrumbItem, BreadcrumbsComponent } from '../../../components/breadcrumbs/breadcrumbs.component';
|
||||||
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
import { PaginatorComponent } from '../../../components/paginator/paginator.component';
|
||||||
import { ModalService } from '../../../components/search-modal/modal.service';
|
import { ModalService } from '../../../components/search-modal/modal.service';
|
||||||
import { SearchModalCommercialComponent } from '../../../components/search-modal/search-modal-commercial.component';
|
import { SearchModalCommercialComponent } from '../../../components/search-modal/search-modal-commercial.component';
|
||||||
import { LazyLoadImageDirective } from '../../../directives/lazy-load-image.directive';
|
import { LazyLoadImageDirective } from '../../../directives/lazy-load-image.directive';
|
||||||
import { AltTextService } from '../../../services/alt-text.service';
|
import { AltTextService } from '../../../services/alt-text.service';
|
||||||
import { FilterStateService } from '../../../services/filter-state.service';
|
import { FilterStateService } from '../../../services/filter-state.service';
|
||||||
import { ImageService } from '../../../services/image.service';
|
import { ImageService } from '../../../services/image.service';
|
||||||
import { ListingsService } from '../../../services/listings.service';
|
import { ListingsService } from '../../../services/listings.service';
|
||||||
import { SearchService } from '../../../services/search.service';
|
import { SearchService } from '../../../services/search.service';
|
||||||
import { SelectOptionsService } from '../../../services/select-options.service';
|
import { SelectOptionsService } from '../../../services/select-options.service';
|
||||||
import { SeoService } from '../../../services/seo.service';
|
import { SeoService } from '../../../services/seo.service';
|
||||||
import { AuthService } from '../../../services/auth.service';
|
import { AuthService } from '../../../services/auth.service';
|
||||||
import { map2User } from '../../../utils/utils';
|
import { map2User } from '../../../utils/utils';
|
||||||
|
|
||||||
@UntilDestroy()
|
@UntilDestroy()
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-commercial-property-listings',
|
selector: 'app-commercial-property-listings',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, SearchModalCommercialComponent, LazyLoadImageDirective, BreadcrumbsComponent],
|
imports: [CommonModule, FormsModule, RouterModule, PaginatorComponent, SearchModalCommercialComponent, LazyLoadImageDirective, BreadcrumbsComponent],
|
||||||
templateUrl: './commercial-property-listings.component.html',
|
templateUrl: './commercial-property-listings.component.html',
|
||||||
styleUrls: ['./commercial-property-listings.component.scss', '../../pages.scss'],
|
styleUrls: ['./commercial-property-listings.component.scss', '../../pages.scss'],
|
||||||
})
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
export class CommercialPropertyListingsComponent implements OnInit, OnDestroy {
|
})
|
||||||
private destroy$ = new Subject<void>();
|
export class CommercialPropertyListingsComponent implements OnInit, OnDestroy {
|
||||||
|
private destroy$ = new Subject<void>();
|
||||||
// Component properties
|
|
||||||
environment = environment;
|
// Component properties
|
||||||
env = environment;
|
environment = environment;
|
||||||
listings: Array<CommercialPropertyListing> = [];
|
env = environment;
|
||||||
filteredListings: Array<CommercialPropertyListing> = [];
|
listings: Array<CommercialPropertyListing> = [];
|
||||||
criteria: CommercialPropertyListingCriteria;
|
filteredListings: Array<CommercialPropertyListing> = [];
|
||||||
sortBy: SortByOptions | null = null;
|
criteria: CommercialPropertyListingCriteria;
|
||||||
|
sortBy: SortByOptions | null = null;
|
||||||
// Pagination
|
|
||||||
totalRecords = 0;
|
// Pagination
|
||||||
page = 1;
|
totalRecords = 0;
|
||||||
pageCount = 1;
|
page = 1;
|
||||||
first = 0;
|
pageCount = 1;
|
||||||
rows = LISTINGS_PER_PAGE;
|
first = 0;
|
||||||
|
rows = LISTINGS_PER_PAGE;
|
||||||
// UI state
|
|
||||||
ts = new Date().getTime();
|
// UI state
|
||||||
|
ts = new Date().getTime();
|
||||||
// Breadcrumbs
|
|
||||||
breadcrumbs: BreadcrumbItem[] = [
|
// Breadcrumbs
|
||||||
{ label: 'Home', url: '/home', icon: 'fas fa-home' },
|
breadcrumbs: BreadcrumbItem[] = [
|
||||||
{ label: 'Commercial Properties' }
|
{ label: 'Home', url: '/home', icon: 'fas fa-home' },
|
||||||
];
|
{ label: 'Commercial Properties' }
|
||||||
|
];
|
||||||
// User for favorites
|
|
||||||
user: KeycloakUser | null = null;
|
// User for favorites
|
||||||
|
user: KeycloakUser | null = null;
|
||||||
constructor(
|
|
||||||
public altText: AltTextService,
|
constructor(
|
||||||
public selectOptions: SelectOptionsService,
|
public altText: AltTextService,
|
||||||
private listingsService: ListingsService,
|
public selectOptions: SelectOptionsService,
|
||||||
private router: Router,
|
private listingsService: ListingsService,
|
||||||
private cdRef: ChangeDetectorRef,
|
private router: Router,
|
||||||
private imageService: ImageService,
|
private cdRef: ChangeDetectorRef,
|
||||||
private searchService: SearchService,
|
private imageService: ImageService,
|
||||||
private modalService: ModalService,
|
private searchService: SearchService,
|
||||||
private filterStateService: FilterStateService,
|
private modalService: ModalService,
|
||||||
private route: ActivatedRoute,
|
private filterStateService: FilterStateService,
|
||||||
private seoService: SeoService,
|
private route: ActivatedRoute,
|
||||||
private authService: AuthService,
|
private seoService: SeoService,
|
||||||
) {}
|
private authService: AuthService,
|
||||||
|
) {}
|
||||||
async ngOnInit(): Promise<void> {
|
|
||||||
// Load user for favorites functionality
|
async ngOnInit(): Promise<void> {
|
||||||
const token = await this.authService.getToken();
|
// Load user for favorites functionality
|
||||||
this.user = map2User(token);
|
const token = await this.authService.getToken();
|
||||||
|
this.user = map2User(token);
|
||||||
// Set SEO meta tags for commercial property listings page
|
|
||||||
this.seoService.updateMetaTags({
|
// Set SEO meta tags for commercial property listings page
|
||||||
title: 'Commercial Properties for Sale - Office, Retail, Industrial Real Estate | BizMatch',
|
this.seoService.updateMetaTags({
|
||||||
description: 'Browse commercial real estate listings including office buildings, retail spaces, warehouses, and industrial properties. Investment opportunities from verified sellers and brokers across the United States.',
|
title: 'Commercial Properties for Sale - Office, Retail | BizMatch',
|
||||||
keywords: 'commercial property for sale, commercial real estate, office building for sale, retail space for sale, warehouse for sale, industrial property, investment property, commercial property listings',
|
description: 'Browse commercial real estate: office buildings, retail spaces, warehouses, and industrial properties. Verified investment opportunities.',
|
||||||
type: 'website'
|
keywords: 'commercial property for sale, commercial real estate, office building for sale, retail space for sale, warehouse for sale, industrial property, investment property, commercial property listings',
|
||||||
});
|
type: 'website'
|
||||||
|
});
|
||||||
// Subscribe to state changes
|
|
||||||
this.filterStateService
|
// Subscribe to state changes
|
||||||
.getState$('commercialPropertyListings')
|
this.filterStateService
|
||||||
.pipe(takeUntil(this.destroy$))
|
.getState$('commercialPropertyListings')
|
||||||
.subscribe(state => {
|
.pipe(takeUntil(this.destroy$))
|
||||||
this.criteria = state.criteria;
|
.subscribe(state => {
|
||||||
this.sortBy = state.sortBy;
|
this.criteria = state.criteria;
|
||||||
// Automatically search when state changes
|
this.sortBy = state.sortBy;
|
||||||
this.search();
|
// Automatically search when state changes
|
||||||
});
|
this.search();
|
||||||
|
});
|
||||||
// Subscribe to search triggers (if triggered from other components)
|
|
||||||
this.searchService.searchTrigger$.pipe(takeUntil(this.destroy$)).subscribe(type => {
|
// Subscribe to search triggers (if triggered from other components)
|
||||||
if (type === 'commercialPropertyListings') {
|
this.searchService.searchTrigger$.pipe(takeUntil(this.destroy$)).subscribe(type => {
|
||||||
this.search();
|
if (type === 'commercialPropertyListings') {
|
||||||
}
|
this.search();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
async search(): Promise<void> {
|
|
||||||
try {
|
async search(): Promise<void> {
|
||||||
// Perform search
|
try {
|
||||||
const listingResponse = await this.listingsService.getListings('commercialProperty');
|
// Perform search
|
||||||
this.listings = (listingResponse as ResponseCommercialPropertyListingArray).results;
|
const listingResponse = await this.listingsService.getListings('commercialProperty');
|
||||||
this.totalRecords = (listingResponse as ResponseCommercialPropertyListingArray).totalCount;
|
this.listings = (listingResponse as ResponseCommercialPropertyListingArray).results;
|
||||||
this.pageCount = Math.ceil(this.totalRecords / LISTINGS_PER_PAGE);
|
this.totalRecords = (listingResponse as ResponseCommercialPropertyListingArray).totalCount;
|
||||||
this.page = this.criteria.page || 1;
|
this.pageCount = Math.ceil(this.totalRecords / LISTINGS_PER_PAGE);
|
||||||
|
this.page = this.criteria.page || 1;
|
||||||
// Update pagination SEO links
|
|
||||||
this.updatePaginationSEO();
|
// Update pagination SEO links
|
||||||
|
this.updatePaginationSEO();
|
||||||
// Update view
|
|
||||||
this.cdRef.markForCheck();
|
// Update view
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.markForCheck();
|
||||||
} catch (error) {
|
this.cdRef.detectChanges();
|
||||||
console.error('Search error:', error);
|
} catch (error) {
|
||||||
// Handle error appropriately
|
console.error('Search error:', error);
|
||||||
this.listings = [];
|
// Handle error appropriately
|
||||||
this.totalRecords = 0;
|
this.listings = [];
|
||||||
this.cdRef.markForCheck();
|
this.totalRecords = 0;
|
||||||
}
|
this.cdRef.markForCheck();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onPageChange(page: number): void {
|
|
||||||
// Update only pagination properties
|
onPageChange(page: number): void {
|
||||||
this.filterStateService.updateCriteria('commercialPropertyListings', {
|
// Update only pagination properties
|
||||||
page: page,
|
this.filterStateService.updateCriteria('commercialPropertyListings', {
|
||||||
start: (page - 1) * LISTINGS_PER_PAGE,
|
page: page,
|
||||||
length: LISTINGS_PER_PAGE,
|
start: (page - 1) * LISTINGS_PER_PAGE,
|
||||||
});
|
length: LISTINGS_PER_PAGE,
|
||||||
// Search will be triggered automatically through state subscription
|
});
|
||||||
}
|
// Search will be triggered automatically through state subscription
|
||||||
|
}
|
||||||
clearAllFilters(): void {
|
|
||||||
// Reset criteria but keep sortBy
|
clearAllFilters(): void {
|
||||||
this.filterStateService.clearFilters('commercialPropertyListings');
|
// Reset criteria but keep sortBy
|
||||||
// Search will be triggered automatically through state subscription
|
this.filterStateService.clearFilters('commercialPropertyListings');
|
||||||
}
|
// Search will be triggered automatically through state subscription
|
||||||
|
}
|
||||||
async openFilterModal(): Promise<void> {
|
|
||||||
// Open modal with current criteria
|
async openFilterModal(): Promise<void> {
|
||||||
const currentCriteria = this.filterStateService.getCriteria('commercialPropertyListings');
|
// Open modal with current criteria
|
||||||
const modalResult = await this.modalService.showModal(currentCriteria);
|
const currentCriteria = this.filterStateService.getCriteria('commercialPropertyListings');
|
||||||
|
const modalResult = await this.modalService.showModal(currentCriteria);
|
||||||
if (modalResult.accepted) {
|
|
||||||
// Modal accepted changes - state is updated by modal
|
if (modalResult.accepted) {
|
||||||
// Search will be triggered automatically through state subscription
|
// Modal accepted changes - state is updated by modal
|
||||||
} else {
|
// Search will be triggered automatically through state subscription
|
||||||
// Modal was cancelled - no action needed
|
} else {
|
||||||
}
|
// Modal was cancelled - no action needed
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Helper methods for template
|
|
||||||
getTS(): number {
|
// Helper methods for template
|
||||||
return new Date().getTime();
|
getTS(): number {
|
||||||
}
|
return new Date().getTime();
|
||||||
|
}
|
||||||
getDaysListed(listing: CommercialPropertyListing): number {
|
|
||||||
return dayjs().diff(listing.created, 'day');
|
getDaysListed(listing: CommercialPropertyListing): number {
|
||||||
}
|
return dayjs().diff(listing.created, 'day');
|
||||||
|
}
|
||||||
getListingImage(listing: CommercialPropertyListing): string {
|
|
||||||
if (listing.imageOrder?.length > 0) {
|
getListingImage(listing: CommercialPropertyListing): string {
|
||||||
return `${this.env.imageBaseUrl}/pictures/property/${listing.imagePath}/${listing.serialId}/${listing.imageOrder[0]}`;
|
if (listing.imageOrder?.length > 0) {
|
||||||
}
|
return `${this.env.imageBaseUrl}/pictures/property/${listing.imagePath}/${listing.serialId}/${listing.imageOrder[0]}`;
|
||||||
return 'assets/images/placeholder_properties.jpg';
|
}
|
||||||
}
|
return 'assets/images/placeholder_properties.jpg';
|
||||||
|
}
|
||||||
getListingPrice(listing: CommercialPropertyListing): string {
|
|
||||||
if (!listing.price) return 'Price on Request';
|
getListingPrice(listing: CommercialPropertyListing): string {
|
||||||
return `$${listing.price.toLocaleString()}`;
|
if (!listing.price) return 'Price on Request';
|
||||||
}
|
return `$${listing.price.toLocaleString()}`;
|
||||||
|
}
|
||||||
getListingLocation(listing: CommercialPropertyListing): string {
|
|
||||||
if (!listing.location) return 'Location not specified';
|
getListingLocation(listing: CommercialPropertyListing): string {
|
||||||
return listing.location.name || listing.location.county || 'Location not specified';
|
if (!listing.location) return 'Location not specified';
|
||||||
}
|
return listing.location.name || listing.location.county || 'Location not specified';
|
||||||
|
}
|
||||||
navigateToDetails(listingId: string): void {
|
|
||||||
this.router.navigate(['/details-commercial-property-listing', listingId]);
|
navigateToDetails(listingId: string): void {
|
||||||
}
|
this.router.navigate(['/details-commercial-property-listing', listingId]);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Check if listing is already in user's favorites
|
/**
|
||||||
*/
|
* Check if listing is already in user's favorites
|
||||||
isFavorite(listing: CommercialPropertyListing): boolean {
|
*/
|
||||||
if (!this.user?.email || !listing.favoritesForUser) return false;
|
isFavorite(listing: CommercialPropertyListing): boolean {
|
||||||
return listing.favoritesForUser.includes(this.user.email);
|
if (!this.user?.email || !listing.favoritesForUser) return false;
|
||||||
}
|
return listing.favoritesForUser.includes(this.user.email);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Toggle favorite status for a listing
|
/**
|
||||||
*/
|
* Toggle favorite status for a listing
|
||||||
async toggleFavorite(event: Event, listing: CommercialPropertyListing): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async toggleFavorite(event: Event, listing: CommercialPropertyListing): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
if (!this.user?.email) {
|
|
||||||
// User not logged in - redirect to login
|
if (!this.user?.email) {
|
||||||
this.router.navigate(['/login']);
|
// User not logged in - redirect to login
|
||||||
return;
|
this.router.navigate(['/login']);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
try {
|
|
||||||
if (this.isFavorite(listing)) {
|
try {
|
||||||
// Remove from favorites
|
if (this.isFavorite(listing)) {
|
||||||
await this.listingsService.removeFavorite(listing.id, 'commercialProperty');
|
// Remove from favorites
|
||||||
listing.favoritesForUser = listing.favoritesForUser.filter(email => email !== this.user!.email);
|
await this.listingsService.removeFavorite(listing.id, 'commercialProperty');
|
||||||
} else {
|
listing.favoritesForUser = listing.favoritesForUser.filter(email => email !== this.user!.email);
|
||||||
// Add to favorites
|
} else {
|
||||||
await this.listingsService.addToFavorites(listing.id, 'commercialProperty');
|
// Add to favorites
|
||||||
if (!listing.favoritesForUser) {
|
await this.listingsService.addToFavorites(listing.id, 'commercialProperty');
|
||||||
listing.favoritesForUser = [];
|
if (!listing.favoritesForUser) {
|
||||||
}
|
listing.favoritesForUser = [];
|
||||||
listing.favoritesForUser.push(this.user.email);
|
}
|
||||||
}
|
listing.favoritesForUser.push(this.user.email);
|
||||||
this.cdRef.detectChanges();
|
}
|
||||||
} catch (error) {
|
this.cdRef.detectChanges();
|
||||||
console.error('Error toggling favorite:', error);
|
} catch (error) {
|
||||||
}
|
console.error('Error toggling favorite:', error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.destroy$.next();
|
ngOnDestroy(): void {
|
||||||
this.destroy$.complete();
|
this.destroy$.next();
|
||||||
// Clean up pagination links when leaving the page
|
this.destroy$.complete();
|
||||||
this.seoService.clearPaginationLinks();
|
// Clean up pagination links when leaving the page
|
||||||
}
|
this.seoService.clearPaginationLinks();
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Update pagination SEO links (rel="next/prev") and CollectionPage schema
|
/**
|
||||||
*/
|
* Update pagination SEO links (rel="next/prev") and CollectionPage schema
|
||||||
private updatePaginationSEO(): void {
|
*/
|
||||||
const baseUrl = `${this.seoService.getBaseUrl()}/commercialPropertyListings`;
|
private updatePaginationSEO(): void {
|
||||||
|
const baseUrl = `${this.seoService.getBaseUrl()}/commercialPropertyListings`;
|
||||||
// Inject rel="next" and rel="prev" links
|
|
||||||
this.seoService.injectPaginationLinks(baseUrl, this.page, this.pageCount);
|
// Inject rel="next" and rel="prev" links
|
||||||
|
this.seoService.injectPaginationLinks(baseUrl, this.page, this.pageCount);
|
||||||
// Inject CollectionPage schema for paginated results
|
|
||||||
const collectionSchema = this.seoService.generateCollectionPageSchema({
|
// Inject CollectionPage schema for paginated results
|
||||||
name: 'Commercial Properties for Sale',
|
const collectionSchema = this.seoService.generateCollectionPageSchema({
|
||||||
description: 'Browse commercial real estate listings including office buildings, retail spaces, warehouses, and industrial properties across the United States.',
|
name: 'Commercial Properties for Sale',
|
||||||
totalItems: this.totalRecords,
|
description: 'Browse commercial real estate listings including office buildings, retail spaces, warehouses, and industrial properties across the United States.',
|
||||||
itemsPerPage: LISTINGS_PER_PAGE,
|
totalItems: this.totalRecords,
|
||||||
currentPage: this.page,
|
itemsPerPage: LISTINGS_PER_PAGE,
|
||||||
baseUrl: baseUrl
|
currentPage: this.page,
|
||||||
});
|
baseUrl: baseUrl
|
||||||
this.seoService.injectStructuredData(collectionSchema);
|
});
|
||||||
}
|
this.seoService.injectStructuredData(collectionSchema);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Share property listing
|
/**
|
||||||
*/
|
* Share property listing
|
||||||
async shareProperty(event: Event, listing: CommercialPropertyListing): Promise<void> {
|
*/
|
||||||
event.stopPropagation();
|
async shareProperty(event: Event, listing: CommercialPropertyListing): Promise<void> {
|
||||||
event.preventDefault();
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
const url = `${window.location.origin}/commercial-property/${listing.slug || listing.id}`;
|
|
||||||
const title = listing.title || 'Commercial Property Listing';
|
const url = `${window.location.origin}/commercial-property/${listing.slug || listing.id}`;
|
||||||
|
const title = listing.title || 'Commercial Property Listing';
|
||||||
// Try native share API first (works on mobile and some desktop browsers)
|
|
||||||
if (navigator.share) {
|
// Try native share API first (works on mobile and some desktop browsers)
|
||||||
try {
|
if (navigator.share) {
|
||||||
await navigator.share({
|
try {
|
||||||
title: title,
|
await navigator.share({
|
||||||
text: `Check out this property: ${title}`,
|
title: title,
|
||||||
url: url,
|
text: `Check out this property: ${title}`,
|
||||||
});
|
url: url,
|
||||||
} catch (err) {
|
});
|
||||||
// User cancelled or share failed - fall back to clipboard
|
} catch (err) {
|
||||||
this.copyToClipboard(url);
|
// User cancelled or share failed - fall back to clipboard
|
||||||
}
|
this.copyToClipboard(url);
|
||||||
} else {
|
}
|
||||||
// Fallback: open Facebook share dialog
|
} else {
|
||||||
const encodedUrl = encodeURIComponent(url);
|
// Fallback: open Facebook share dialog
|
||||||
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
const encodedUrl = encodeURIComponent(url);
|
||||||
}
|
window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodedUrl}`, '_blank', 'width=600,height=400');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Copy URL to clipboard and show feedback
|
/**
|
||||||
*/
|
* Copy URL to clipboard and show feedback
|
||||||
private copyToClipboard(url: string): void {
|
*/
|
||||||
navigator.clipboard.writeText(url).then(() => {
|
private copyToClipboard(url: string): void {
|
||||||
console.log('Link copied to clipboard!');
|
navigator.clipboard.writeText(url).then(() => {
|
||||||
}).catch(err => {
|
console.log('Link copied to clipboard!');
|
||||||
console.error('Failed to copy link:', err);
|
}).catch(err => {
|
||||||
});
|
console.error('Failed to copy link:', err);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,135 +1,135 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
export interface SitemapUrl {
|
export interface SitemapUrl {
|
||||||
loc: string;
|
loc: string;
|
||||||
lastmod?: string;
|
lastmod?: string;
|
||||||
changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
|
||||||
priority?: number;
|
priority?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class SitemapService {
|
export class SitemapService {
|
||||||
private readonly baseUrl = 'https://biz-match.com';
|
private readonly baseUrl = 'https://www.bizmatch.net';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate XML sitemap content
|
* Generate XML sitemap content
|
||||||
*/
|
*/
|
||||||
generateSitemap(urls: SitemapUrl[]): string {
|
generateSitemap(urls: SitemapUrl[]): string {
|
||||||
const urlElements = urls.map(url => this.generateUrlElement(url)).join('\n ');
|
const urlElements = urls.map(url => this.generateUrlElement(url)).join('\n ');
|
||||||
|
|
||||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
${urlElements}
|
${urlElements}
|
||||||
</urlset>`;
|
</urlset>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a single URL element for the sitemap
|
* Generate a single URL element for the sitemap
|
||||||
*/
|
*/
|
||||||
private generateUrlElement(url: SitemapUrl): string {
|
private generateUrlElement(url: SitemapUrl): string {
|
||||||
let element = `<url>\n <loc>${url.loc}</loc>`;
|
let element = `<url>\n <loc>${url.loc}</loc>`;
|
||||||
|
|
||||||
if (url.lastmod) {
|
if (url.lastmod) {
|
||||||
element += `\n <lastmod>${url.lastmod}</lastmod>`;
|
element += `\n <lastmod>${url.lastmod}</lastmod>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.changefreq) {
|
if (url.changefreq) {
|
||||||
element += `\n <changefreq>${url.changefreq}</changefreq>`;
|
element += `\n <changefreq>${url.changefreq}</changefreq>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.priority !== undefined) {
|
if (url.priority !== undefined) {
|
||||||
element += `\n <priority>${url.priority.toFixed(1)}</priority>`;
|
element += `\n <priority>${url.priority.toFixed(1)}</priority>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
element += '\n </url>';
|
element += '\n </url>';
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate sitemap URLs for static pages
|
* Generate sitemap URLs for static pages
|
||||||
*/
|
*/
|
||||||
getStaticPageUrls(): SitemapUrl[] {
|
getStaticPageUrls(): SitemapUrl[] {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/`,
|
loc: `${this.baseUrl}/`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 1.0
|
priority: 1.0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/home`,
|
loc: `${this.baseUrl}/home`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 1.0
|
priority: 1.0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/listings`,
|
loc: `${this.baseUrl}/listings`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.9
|
priority: 0.9
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/listings-2`,
|
loc: `${this.baseUrl}/listings-2`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/listings-3`,
|
loc: `${this.baseUrl}/listings-3`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loc: `${this.baseUrl}/listings-4`,
|
loc: `${this.baseUrl}/listings-4`,
|
||||||
changefreq: 'daily',
|
changefreq: 'daily',
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate sitemap URLs for business listings
|
* Generate sitemap URLs for business listings
|
||||||
*/
|
*/
|
||||||
generateBusinessListingUrls(listings: any[]): SitemapUrl[] {
|
generateBusinessListingUrls(listings: any[]): SitemapUrl[] {
|
||||||
return listings.map(listing => ({
|
return listings.map(listing => ({
|
||||||
loc: `${this.baseUrl}/details-business-listing/${listing.id}`,
|
loc: `${this.baseUrl}/details-business-listing/${listing.id}`,
|
||||||
lastmod: this.formatDate(listing.updated || listing.created),
|
lastmod: this.formatDate(listing.updated || listing.created),
|
||||||
changefreq: 'weekly' as const,
|
changefreq: 'weekly' as const,
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate sitemap URLs for commercial property listings
|
* Generate sitemap URLs for commercial property listings
|
||||||
*/
|
*/
|
||||||
generateCommercialPropertyUrls(properties: any[]): SitemapUrl[] {
|
generateCommercialPropertyUrls(properties: any[]): SitemapUrl[] {
|
||||||
return properties.map(property => ({
|
return properties.map(property => ({
|
||||||
loc: `${this.baseUrl}/details-commercial-property/${property.id}`,
|
loc: `${this.baseUrl}/details-commercial-property/${property.id}`,
|
||||||
lastmod: this.formatDate(property.updated || property.created),
|
lastmod: this.formatDate(property.updated || property.created),
|
||||||
changefreq: 'weekly' as const,
|
changefreq: 'weekly' as const,
|
||||||
priority: 0.8
|
priority: 0.8
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format date to ISO 8601 format (YYYY-MM-DD)
|
* Format date to ISO 8601 format (YYYY-MM-DD)
|
||||||
*/
|
*/
|
||||||
private formatDate(date: Date | string): string {
|
private formatDate(date: Date | string): string {
|
||||||
const d = typeof date === 'string' ? new Date(date) : date;
|
const d = typeof date === 'string' ? new Date(date) : date;
|
||||||
return d.toISOString().split('T')[0];
|
return d.toISOString().split('T')[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate complete sitemap with all URLs
|
* Generate complete sitemap with all URLs
|
||||||
*/
|
*/
|
||||||
async generateCompleteSitemap(
|
async generateCompleteSitemap(
|
||||||
businessListings: any[],
|
businessListings: any[],
|
||||||
commercialProperties: any[]
|
commercialProperties: any[]
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const allUrls = [
|
const allUrls = [
|
||||||
...this.getStaticPageUrls(),
|
...this.getStaticPageUrls(),
|
||||||
...this.generateBusinessListingUrls(businessListings),
|
...this.generateBusinessListingUrls(businessListings),
|
||||||
...this.generateCommercialPropertyUrls(commercialProperties)
|
...this.generateCommercialPropertyUrls(commercialProperties)
|
||||||
];
|
];
|
||||||
|
|
||||||
return this.generateSitemap(allUrls);
|
return this.generateSitemap(allUrls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 2.7 MiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 26 MiB After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 7.8 KiB |
|
|
@ -1,6 +1,6 @@
|
||||||
// Build information, automatically generated by `the_build_script` :zwinkern:
|
// Build information, automatically generated by `the_build_script` :zwinkern:
|
||||||
const build = {
|
const build = {
|
||||||
timestamp: "GER: 06.01.2026 22:33 | TX: 01/06/2026 3:33 PM"
|
timestamp: "GER: 03.02.2026 12:44 | TX: 02/03/2026 5:44 AM"
|
||||||
};
|
};
|
||||||
|
|
||||||
export default build;
|
export default build;
|
||||||
|
|
@ -1,140 +1,143 @@
|
||||||
# robots.txt for BizMatch - Business Marketplace
|
# robots.txt for BizMatch - Business Marketplace
|
||||||
# https://biz-match.com
|
# https://www.bizmatch.net
|
||||||
# Last updated: 2026-01-02
|
# Last updated: 2026-02-03
|
||||||
|
|
||||||
# ===========================================
|
# ===========================================
|
||||||
# Default rules for all crawlers
|
# Default rules for all crawlers
|
||||||
# ===========================================
|
# ===========================================
|
||||||
User-agent: *
|
User-agent: *
|
||||||
|
|
||||||
# Allow all public pages
|
# Allow all public pages
|
||||||
Allow: /
|
Allow: /
|
||||||
Allow: /home
|
Allow: /home
|
||||||
Allow: /businessListings
|
Allow: /businessListings
|
||||||
Allow: /commercialPropertyListings
|
Allow: /commercialPropertyListings
|
||||||
Allow: /brokerListings
|
Allow: /brokerListings
|
||||||
Allow: /business/*
|
Allow: /business/*
|
||||||
Allow: /commercial-property/*
|
Allow: /commercial-property/*
|
||||||
Allow: /details-user/*
|
Allow: /details-user/*
|
||||||
Allow: /terms-of-use
|
Allow: /terms-of-use
|
||||||
Allow: /privacy-statement
|
Allow: /privacy-statement
|
||||||
|
|
||||||
# Disallow private/admin areas
|
# Disallow private/admin areas
|
||||||
Disallow: /admin/
|
Disallow: /admin/
|
||||||
Disallow: /account
|
Disallow: /account
|
||||||
Disallow: /myListings
|
Disallow: /myListings
|
||||||
Disallow: /myFavorites
|
Disallow: /myFavorites
|
||||||
Disallow: /createBusinessListing
|
Disallow: /createBusinessListing
|
||||||
Disallow: /createCommercialPropertyListing
|
Disallow: /createCommercialPropertyListing
|
||||||
Disallow: /editBusinessListing/*
|
Disallow: /editBusinessListing/*
|
||||||
Disallow: /editCommercialPropertyListing/*
|
Disallow: /editCommercialPropertyListing/*
|
||||||
Disallow: /login
|
Disallow: /login
|
||||||
Disallow: /logout
|
Disallow: /logout
|
||||||
Disallow: /register
|
Disallow: /register
|
||||||
Disallow: /emailUs
|
Disallow: /emailUs
|
||||||
|
|
||||||
# Disallow duplicate content / API routes
|
# Disallow duplicate content / API routes
|
||||||
Disallow: /api/
|
Disallow: /api/
|
||||||
Disallow: /bizmatch/
|
Disallow: /bizmatch/
|
||||||
|
|
||||||
# Disallow search result pages with parameters (to avoid duplicate content)
|
# Disallow Cloudflare internal paths (prevents 404 errors in crawl reports)
|
||||||
Disallow: /*?*sortBy=
|
Disallow: /cdn-cgi/
|
||||||
Disallow: /*?*page=
|
|
||||||
Disallow: /*?*start=
|
# Disallow search result pages with parameters (to avoid duplicate content)
|
||||||
|
Disallow: /*?*sortBy=
|
||||||
# ===========================================
|
Disallow: /*?*page=
|
||||||
# Google-specific rules
|
Disallow: /*?*start=
|
||||||
# ===========================================
|
|
||||||
User-agent: Googlebot
|
# ===========================================
|
||||||
Allow: /
|
# Google-specific rules
|
||||||
Crawl-delay: 1
|
# ===========================================
|
||||||
|
User-agent: Googlebot
|
||||||
# Allow Google to index images
|
Allow: /
|
||||||
User-agent: Googlebot-Image
|
Crawl-delay: 1
|
||||||
Allow: /assets/
|
|
||||||
Disallow: /assets/leaflet/
|
# Allow Google to index images
|
||||||
|
User-agent: Googlebot-Image
|
||||||
# ===========================================
|
Allow: /assets/
|
||||||
# Bing-specific rules
|
Disallow: /assets/leaflet/
|
||||||
# ===========================================
|
|
||||||
User-agent: Bingbot
|
# ===========================================
|
||||||
Allow: /
|
# Bing-specific rules
|
||||||
Crawl-delay: 2
|
# ===========================================
|
||||||
|
User-agent: Bingbot
|
||||||
# ===========================================
|
Allow: /
|
||||||
# Other major search engines
|
Crawl-delay: 2
|
||||||
# ===========================================
|
|
||||||
User-agent: DuckDuckBot
|
# ===========================================
|
||||||
Allow: /
|
# Other major search engines
|
||||||
Crawl-delay: 2
|
# ===========================================
|
||||||
|
User-agent: DuckDuckBot
|
||||||
User-agent: Slurp
|
Allow: /
|
||||||
Allow: /
|
Crawl-delay: 2
|
||||||
Crawl-delay: 2
|
|
||||||
|
User-agent: Slurp
|
||||||
User-agent: Yandex
|
Allow: /
|
||||||
Allow: /
|
Crawl-delay: 2
|
||||||
Crawl-delay: 5
|
|
||||||
|
User-agent: Yandex
|
||||||
User-agent: Baiduspider
|
Allow: /
|
||||||
Allow: /
|
Crawl-delay: 5
|
||||||
Crawl-delay: 5
|
|
||||||
|
User-agent: Baiduspider
|
||||||
# ===========================================
|
Allow: /
|
||||||
# AI/LLM Crawlers (Answer Engine Optimization)
|
Crawl-delay: 5
|
||||||
# ===========================================
|
|
||||||
User-agent: GPTBot
|
# ===========================================
|
||||||
Allow: /
|
# AI/LLM Crawlers (Answer Engine Optimization)
|
||||||
Allow: /businessListings
|
# ===========================================
|
||||||
Allow: /business/*
|
User-agent: GPTBot
|
||||||
Disallow: /admin/
|
Allow: /
|
||||||
Disallow: /account
|
Allow: /businessListings
|
||||||
|
Allow: /business/*
|
||||||
User-agent: ChatGPT-User
|
Disallow: /admin/
|
||||||
Allow: /
|
Disallow: /account
|
||||||
|
|
||||||
User-agent: Claude-Web
|
User-agent: ChatGPT-User
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
User-agent: Anthropic-AI
|
User-agent: Claude-Web
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
User-agent: PerplexityBot
|
User-agent: Anthropic-AI
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
User-agent: Cohere-ai
|
User-agent: PerplexityBot
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
# ===========================================
|
User-agent: Cohere-ai
|
||||||
# Block unwanted bots
|
Allow: /
|
||||||
# ===========================================
|
|
||||||
User-agent: AhrefsBot
|
# ===========================================
|
||||||
Disallow: /
|
# Block unwanted bots
|
||||||
|
# ===========================================
|
||||||
User-agent: SemrushBot
|
User-agent: AhrefsBot
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
||||||
User-agent: MJ12bot
|
User-agent: SemrushBot
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
||||||
User-agent: DotBot
|
User-agent: MJ12bot
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
||||||
User-agent: BLEXBot
|
User-agent: DotBot
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
||||||
# ===========================================
|
User-agent: BLEXBot
|
||||||
# Sitemap locations
|
Disallow: /
|
||||||
# ===========================================
|
|
||||||
# Main sitemap index (dynamically generated, contains all sub-sitemaps)
|
# ===========================================
|
||||||
Sitemap: https://biz-match.com/bizmatch/sitemap.xml
|
# Sitemap locations
|
||||||
|
# ===========================================
|
||||||
# Individual sitemaps (auto-listed in sitemap index)
|
# Main sitemap index (dynamically generated, contains all sub-sitemaps)
|
||||||
# - https://biz-match.com/bizmatch/sitemap/static.xml
|
Sitemap: https://www.bizmatch.net/bizmatch/sitemap.xml
|
||||||
# - https://biz-match.com/bizmatch/sitemap/business-1.xml
|
|
||||||
# - https://biz-match.com/bizmatch/sitemap/commercial-1.xml
|
# Individual sitemaps (auto-listed in sitemap index)
|
||||||
|
# - https://www.bizmatch.net/bizmatch/sitemap/static.xml
|
||||||
# ===========================================
|
# - https://www.bizmatch.net/bizmatch/sitemap/business-1.xml
|
||||||
# Host directive (for Yandex)
|
# - https://www.bizmatch.net/bizmatch/sitemap/commercial-1.xml
|
||||||
# ===========================================
|
|
||||||
Host: https://biz-match.com
|
# ===========================================
|
||||||
|
# Host directive (for Yandex)
|
||||||
|
# ===========================================
|
||||||
|
Host: https://www.bizmatch.net
|
||||||
|
|
|
||||||