Initial Sepehr Sanaat Next.js storefront with Meshkee catalog and SEO.
Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -0,0 +1,41 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# env files (can opt-in for committing if needed)
|
||||||
|
.env*
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<!-- BEGIN:nextjs-agent-rules -->
|
||||||
|
|
||||||
|
# This is NOT the Next.js you know
|
||||||
|
|
||||||
|
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
|
||||||
|
|
||||||
|
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
|
||||||
|
|
||||||
|
<!-- END:nextjs-agent-rules -->
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
First, run the development server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
# or
|
||||||
|
yarn dev
|
||||||
|
# or
|
||||||
|
pnpm dev
|
||||||
|
# or
|
||||||
|
bun dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||||
|
|
||||||
|
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||||
|
|
||||||
|
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||||
|
|
||||||
|
## Learn More
|
||||||
|
|
||||||
|
To learn more about Next.js, take a look at the following resources:
|
||||||
|
|
||||||
|
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||||
|
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||||
|
|
||||||
|
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||||
|
|
||||||
|
## Deploy on Vercel
|
||||||
|
|
||||||
|
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||||
|
|
||||||
|
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { defineConfig, globalIgnores } from "eslint/config";
|
||||||
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||||
|
import nextTs from "eslint-config-next/typescript";
|
||||||
|
|
||||||
|
const eslintConfig = defineConfig([
|
||||||
|
...nextVitals,
|
||||||
|
...nextTs,
|
||||||
|
// Override default ignores of eslint-config-next.
|
||||||
|
globalIgnores([
|
||||||
|
// Default ignores of eslint-config-next:
|
||||||
|
".next/**",
|
||||||
|
"out/**",
|
||||||
|
"build/**",
|
||||||
|
"next-env.d.ts",
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
|
const nextConfig: NextConfig = {
|
||||||
|
images: {
|
||||||
|
remotePatterns: [
|
||||||
|
{
|
||||||
|
protocol: "https",
|
||||||
|
hostname: "c804387.parspack.net",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "sepehr-sanaat",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "eslint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"next": "16.3.1",
|
||||||
|
"react": "19.2.8",
|
||||||
|
"react-dom": "19.2.8"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@types/node": "^20",
|
||||||
|
"@types/react": "^19",
|
||||||
|
"@types/react-dom": "^19",
|
||||||
|
"eslint": "^9",
|
||||||
|
"eslint-config-next": "16.3.1",
|
||||||
|
"tailwindcss": "^4",
|
||||||
|
"typescript": "^5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
const config = {
|
||||||
|
plugins: {
|
||||||
|
"@tailwindcss/postcss": {},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
Create a website for industrial website, air conditioning and ventilations
|
||||||
|
You can inspire from or clone this old website: sepehrsanaat.com
|
||||||
|
You can use banners, icon and color Pallete from this website
|
||||||
|
|
||||||
|
Pick data from current website - all data is valid
|
||||||
|
Lang:fa
|
||||||
|
Directions: rtl
|
||||||
|
Use next js
|
||||||
|
Color palette like website
|
||||||
|
use flat design
|
||||||
|
|
||||||
|
Design only homepage
|
||||||
|
Use Persian font like iran-yekan or kalameh or iran sans and some cool kids like English font
|
||||||
|
Do not use images - show only placeholders images - use empty image file so they can be replace easily
|
||||||
|
Do not use text over the images or banners - even slider
|
||||||
|
|
||||||
|
Sections are:
|
||||||
|
1.Top header bar
|
||||||
|
2. Header
|
||||||
|
3. Sliders - three unit under it
|
||||||
|
4. categories
|
||||||
|
7. Two banner
|
||||||
|
8. Product Top selling carousel
|
||||||
|
9. 3 banner
|
||||||
|
11. About us
|
||||||
|
12. Latest blog carousel
|
||||||
|
13. footer
|
||||||
|
|
||||||
|
For header, as first item add a products, with drop down of top parent categories
|
||||||
|
Other link are: special sale - about us - FAQs - contact us
|
||||||
|
|
||||||
|
Documentation for backend is:https://api.meshkee.com/docs/website
|
||||||
|
But do not connect is unless I say so
|
||||||
|
|
||||||
|
Login or user icon should go to customer.{domainName}.com
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||||
|
After Width: | Height: | Size: 391 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 578 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 414 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 578 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 109 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,15 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
|
||||||
|
<g fill="none" stroke="#fff" stroke-width="0.7">
|
||||||
|
<path d="M48 0v96M0 48h96" opacity="0.28"/>
|
||||||
|
<path d="M0 0h96v96H0Z" opacity="0.1"/>
|
||||||
|
<circle cx="48" cy="48" r="14" opacity="0.22"/>
|
||||||
|
<circle cx="48" cy="48" r="28" opacity="0.12"/>
|
||||||
|
</g>
|
||||||
|
<g fill="#fff">
|
||||||
|
<circle cx="0" cy="0" r="1.6" opacity="0.4"/>
|
||||||
|
<circle cx="96" cy="0" r="1.6" opacity="0.4"/>
|
||||||
|
<circle cx="0" cy="96" r="1.6" opacity="0.4"/>
|
||||||
|
<circle cx="96" cy="96" r="1.6" opacity="0.4"/>
|
||||||
|
<circle cx="48" cy="48" r="2" opacity="0.45"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
|
After Width: | Height: | Size: 69 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||||
|
After Width: | Height: | Size: 128 B |
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||||
|
After Width: | Height: | Size: 385 B |
@@ -0,0 +1,100 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { about } from "@/data/site";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { Placeholder } from "@/components/ui/Placeholder";
|
||||||
|
import { SectionTitle } from "@/components/ui/SectionTitle";
|
||||||
|
import { DesignIcon, SalesIcon, ServiceIcon } from "@/components/icons";
|
||||||
|
|
||||||
|
const icons = {
|
||||||
|
sales: SalesIcon,
|
||||||
|
service: ServiceIcon,
|
||||||
|
design: DesignIcon,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "درباره ما",
|
||||||
|
description: "معرفی شرکت فنی مهندسی سپهرصنعت؛ مشاوره، طراحی، تامین تجهیزات و خدمات پس از فروش تاسیسات.",
|
||||||
|
alternates: { canonical: "/about" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function AboutPage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title={about.title}
|
||||||
|
titleEn={about.titleEn}
|
||||||
|
description="معرفی شرکت مهندسی سپهرصنعت"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<section className="bg-white py-14">
|
||||||
|
<Container>
|
||||||
|
<SectionTitle title={about.introTitle} titleEn={about.introTitleEn} />
|
||||||
|
<div className="grid items-start gap-10 lg:grid-cols-[1.15fr_0.85fr]">
|
||||||
|
<div>
|
||||||
|
{about.paragraphs.map((paragraph) => (
|
||||||
|
<p key={paragraph.slice(0, 24)} className="mb-4 text-[15px] leading-8 text-muted">
|
||||||
|
{paragraph}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<Placeholder
|
||||||
|
src={about.image}
|
||||||
|
alt="معرفی شرکت مهندسی سپهرصنعت"
|
||||||
|
className="aspect-[5/4] rounded-xl border border-line"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="bg-navy py-14 text-white">
|
||||||
|
<Container className="max-w-3xl text-center">
|
||||||
|
<h2 className="text-[22px] font-extrabold sm:text-[26px]">{about.cooperationTitle}</h2>
|
||||||
|
<p className="font-display mt-1 text-[11px] font-semibold tracking-[0.22em] text-white/55 uppercase">
|
||||||
|
{about.cooperationTitleEn}
|
||||||
|
</p>
|
||||||
|
<p className="mt-5 text-[15px] leading-8 text-white/85">{about.cooperationText}</p>
|
||||||
|
<a
|
||||||
|
href="/contact"
|
||||||
|
className="mt-7 inline-flex h-11 items-center rounded-md bg-white px-5 text-sm font-bold text-navy hover:bg-surface"
|
||||||
|
>
|
||||||
|
تماس با ما
|
||||||
|
</a>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="bg-surface py-14">
|
||||||
|
<Container>
|
||||||
|
<SectionTitle title={about.domainsTitle} titleEn={about.domainsTitleEn} />
|
||||||
|
<p className="mb-8 max-w-3xl text-[15px] leading-8 text-muted">{about.domainsIntro}</p>
|
||||||
|
<div className="grid gap-4 md:grid-cols-3">
|
||||||
|
{about.domains.map((domain, index) => {
|
||||||
|
const Icon = icons[domain.icon];
|
||||||
|
return (
|
||||||
|
<article
|
||||||
|
key={domain.id}
|
||||||
|
id={domain.id}
|
||||||
|
className="scroll-mt-28 rounded-xl border border-line bg-white p-6"
|
||||||
|
>
|
||||||
|
<div className="mb-5 flex items-start justify-between gap-3">
|
||||||
|
<span className="flex h-12 w-12 items-center justify-center rounded-lg bg-navy text-white">
|
||||||
|
<Icon className="h-7 w-7" />
|
||||||
|
</span>
|
||||||
|
<span className="font-display text-2xl font-semibold text-navy/15">
|
||||||
|
{String(index + 1).padStart(2, "0")}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<h3 className="text-[17px] font-extrabold text-navy">{domain.title}</h3>
|
||||||
|
<p className="font-display mt-1 text-[10px] font-semibold tracking-[0.18em] text-muted">
|
||||||
|
{domain.titleEn}
|
||||||
|
</p>
|
||||||
|
<p className="mt-4 text-[14px] leading-8 text-muted">{domain.body}</p>
|
||||||
|
</article>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</section>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { SITE_DOMAIN } from "@/lib/api";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
export async function POST(request: Request) {
|
||||||
|
const body = await request.json();
|
||||||
|
const response = await fetch(
|
||||||
|
`https://api.meshkee.com/api/v1/tenants/${SITE_DOMAIN}/contact-submissions`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json", Accept: "application/json" },
|
||||||
|
body: JSON.stringify({
|
||||||
|
title: body.title,
|
||||||
|
name: body.name,
|
||||||
|
text: body.text,
|
||||||
|
email: body.email || undefined,
|
||||||
|
cellNumber: body.cellNumber || undefined,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
return NextResponse.json({ ok: false }, { status: response.status });
|
||||||
|
}
|
||||||
|
return NextResponse.json({ ok: true });
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import { getProducts, getStoreItems } from "@/lib/api";
|
||||||
|
import { mapProductCard, mapStoreItemCard } from "@/lib/catalog";
|
||||||
|
|
||||||
|
export async function GET(request: Request) {
|
||||||
|
const q = new URL(request.url).searchParams.get("q")?.trim() ?? "";
|
||||||
|
if (q.length < 3) {
|
||||||
|
return NextResponse.json({ items: [] });
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const store = await getStoreItems({ pageSize: 8, name: q });
|
||||||
|
const items =
|
||||||
|
store.total > 0
|
||||||
|
? store.items.map(mapStoreItemCard)
|
||||||
|
: (await getProducts({ pageSize: 8, name: q })).items.map(mapProductCard);
|
||||||
|
return NextResponse.json({ items });
|
||||||
|
} catch {
|
||||||
|
return NextResponse.json({ items: [] }, { status: 500 });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import { notFound } from "next/navigation";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { HtmlContent } from "@/components/ui/HtmlContent";
|
||||||
|
import { ApiNotFoundError, formatFaDate, getBlog, getBlogCover } from "@/lib/api";
|
||||||
|
|
||||||
|
type PageProps = { params: Promise<{ slug: string }> };
|
||||||
|
|
||||||
|
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
||||||
|
const { slug } = await params;
|
||||||
|
try {
|
||||||
|
const post = await getBlog(slug);
|
||||||
|
return {
|
||||||
|
title: post.title,
|
||||||
|
description: post.abstract || post.title,
|
||||||
|
alternates: { canonical: `/articles/${slug}` },
|
||||||
|
openGraph: {
|
||||||
|
title: post.title,
|
||||||
|
description: post.abstract || post.title,
|
||||||
|
type: "article",
|
||||||
|
images: getBlogCover(post) ? [{ url: getBlogCover(post), alt: post.title }] : undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return { title: "مقاله" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function ArticlePage({ params }: PageProps) {
|
||||||
|
const { slug } = await params;
|
||||||
|
try {
|
||||||
|
const post = await getBlog(slug);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader title={post.title} titleEn="ARTICLE" />
|
||||||
|
<Container className="py-10">
|
||||||
|
<div className="overflow-hidden rounded-xl border border-line">
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={getBlogCover(post)}
|
||||||
|
alt={post.title}
|
||||||
|
className="h-auto w-full object-contain"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p className="mt-5 text-sm text-muted">
|
||||||
|
{formatFaDate(post.publishedAt)}
|
||||||
|
{post.categoryName ? ` — ${post.categoryName}` : ""}
|
||||||
|
</p>
|
||||||
|
{post.abstract ? (
|
||||||
|
<p className="mt-4 text-[15px] leading-8 text-ink">{post.abstract}</p>
|
||||||
|
) : null}
|
||||||
|
{post.mainTextHtml ? (
|
||||||
|
<div className="mt-6">
|
||||||
|
<HtmlContent html={post.mainTextHtml} />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof ApiNotFoundError) notFound();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { getBlogCover, getBlogs, formatFaDate } from "@/lib/api";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "مقالات",
|
||||||
|
description: "مقالات تخصصی تهویه مطبوع، سرمایش و گرمایش.",
|
||||||
|
alternates: { canonical: "/articles" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ArticlesPage() {
|
||||||
|
const { items } = await getBlogs({ pageSize: 12 });
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title="مقالات"
|
||||||
|
titleEn="ARTICLES"
|
||||||
|
description="مقالات تخصصی تهویه مطبوع، سرمایش و گرمایش"
|
||||||
|
/>
|
||||||
|
<Container className="py-10">
|
||||||
|
<div className="grid gap-5 sm:grid-cols-2 md:grid-cols-3">
|
||||||
|
{items.map((post) => (
|
||||||
|
<article
|
||||||
|
key={post.id}
|
||||||
|
className="overflow-hidden rounded-xl border border-line bg-white"
|
||||||
|
>
|
||||||
|
<a href={`/articles/${post.slug}`} className="block bg-white">
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={getBlogCover(post)}
|
||||||
|
alt={post.title}
|
||||||
|
className="h-auto w-full object-contain"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<div className="space-y-2 p-5">
|
||||||
|
<p className="text-xs text-muted">{formatFaDate(post.publishedAt)}</p>
|
||||||
|
<h2 className="text-[16px] font-extrabold leading-7 text-navy">
|
||||||
|
<a href={`/articles/${post.slug}`}>{post.title}</a>
|
||||||
|
</h2>
|
||||||
|
<p className="line-clamp-3 text-sm leading-7 text-muted">{post.abstract}</p>
|
||||||
|
<a href={`/articles/${post.slug}`} className="inline-block text-sm font-bold text-brand">
|
||||||
|
بیشتر بخوانید
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { site } from "@/data/site";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { ContactForm } from "@/components/contact/ContactForm";
|
||||||
|
import { MailIcon, MapPinIcon, PhoneIcon } from "@/components/icons";
|
||||||
|
|
||||||
|
const mapQuery = encodeURIComponent(site.address);
|
||||||
|
const mapEmbedSrc = `https://maps.google.com/maps?q=${mapQuery}&hl=fa&z=${site.map.zoom}&output=embed`;
|
||||||
|
const mapLink = `https://www.google.com/maps/search/?api=1&query=${mapQuery}`;
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "تماس با ما",
|
||||||
|
description: `${site.address} — تلفن ${site.phones.join(" و ")}`,
|
||||||
|
alternates: { canonical: "/contact" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ContactPage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title="تماس با ما"
|
||||||
|
titleEn="CONTACT US"
|
||||||
|
description="در دسترس هستیم. در صورت نیاز به کمک سریع با ما تماس بگیرید."
|
||||||
|
/>
|
||||||
|
<Container className="grid gap-8 py-10 lg:grid-cols-2">
|
||||||
|
<div className="rounded-xl border border-line bg-white p-6">
|
||||||
|
<h2 className="mb-5 text-lg font-extrabold text-navy">اطلاعات تماس</h2>
|
||||||
|
<ul className="space-y-5 text-[15px] leading-8">
|
||||||
|
<li className="flex gap-3">
|
||||||
|
<span className="mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-navy text-white">
|
||||||
|
<MapPinIcon className="h-4 w-4" />
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-bold text-navy">آدرس</p>
|
||||||
|
<p className="text-muted">{site.address}</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="flex gap-3">
|
||||||
|
<span className="mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-navy text-white">
|
||||||
|
<PhoneIcon className="h-4 w-4" />
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-bold text-navy">تلفن</p>
|
||||||
|
<p className="text-navy">{site.phones.join(" — ")}</p>
|
||||||
|
<p className="text-sm text-muted">فکس: {site.fax}</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li className="flex gap-3">
|
||||||
|
<span className="mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-navy text-white">
|
||||||
|
<MailIcon className="h-4 w-4" />
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-bold text-navy">ایمیل</p>
|
||||||
|
<div className="space-y-0.5 font-display text-sm tracking-wide">
|
||||||
|
{site.emails.map((email) => (
|
||||||
|
<p key={email}>
|
||||||
|
<a href={`mailto:${email}`} className="text-muted hover:text-navy">
|
||||||
|
{email}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<ContactForm />
|
||||||
|
</Container>
|
||||||
|
<Container className="pb-14">
|
||||||
|
<div className="overflow-hidden rounded-xl border border-line">
|
||||||
|
<iframe
|
||||||
|
title="موقعیت شرکت فنی مهندسی سپهر صنعت"
|
||||||
|
src={mapEmbedSrc}
|
||||||
|
className="h-[240px] w-full border-0 sm:h-[380px]"
|
||||||
|
loading="lazy"
|
||||||
|
referrerPolicy="no-referrer-when-downgrade"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<a
|
||||||
|
href={mapLink}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="mt-3 inline-flex items-center gap-2 text-sm font-bold text-brand hover:text-navy"
|
||||||
|
>
|
||||||
|
<MapPinIcon className="h-4 w-4" />
|
||||||
|
مشاهده در نقشه
|
||||||
|
</a>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { faqs } from "@/data/site";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "سوالات متداول",
|
||||||
|
description: "پاسخ پرسشهای رایج درباره محصولات و خدمات سپهر صنعت.",
|
||||||
|
alternates: { canonical: "/faq" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function FaqPage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title="سوالات متداول"
|
||||||
|
titleEn="FAQ"
|
||||||
|
description="پاسخ پرسشهای رایج درباره محصولات و خدمات سپهر صنعت"
|
||||||
|
/>
|
||||||
|
<Container className="py-10">
|
||||||
|
<div className="space-y-3">
|
||||||
|
{faqs.map((item) => (
|
||||||
|
<details
|
||||||
|
key={item.q}
|
||||||
|
className="rounded-xl border border-line bg-white px-5 py-4"
|
||||||
|
>
|
||||||
|
<summary className="cursor-pointer font-bold text-navy">{item.q}</summary>
|
||||||
|
<p className="mt-3 text-sm leading-7 text-muted">{item.a}</p>
|
||||||
|
</details>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,35 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--background: #ffffff;
|
||||||
|
--foreground: #222222;
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme inline {
|
||||||
|
--color-background: var(--background);
|
||||||
|
--color-foreground: var(--foreground);
|
||||||
|
--color-navy: #00266a;
|
||||||
|
--color-navy-deep: #001844;
|
||||||
|
--color-brand: #033e84;
|
||||||
|
--color-ink: #222222;
|
||||||
|
--color-muted: #5c6873;
|
||||||
|
--color-line: #e1e1e1;
|
||||||
|
--color-surface: #f5f7fa;
|
||||||
|
--color-paper: #ffffff;
|
||||||
|
--font-sans: var(--font-vazir), Tahoma, sans-serif;
|
||||||
|
--font-display: var(--font-oswald), var(--font-vazir), Tahoma, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background: var(--color-paper);
|
||||||
|
color: var(--color-ink);
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-display {
|
||||||
|
font-family: var(--font-display);
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { Vazirmatn, Oswald } from "next/font/google";
|
||||||
|
import { TopBar } from "@/components/layout/TopBar";
|
||||||
|
import { Header } from "@/components/layout/Header";
|
||||||
|
import { Footer } from "@/components/layout/Footer";
|
||||||
|
import { WhatsappFab } from "@/components/layout/WhatsappFab";
|
||||||
|
import { site } from "@/data/site";
|
||||||
|
import { getProductCategories } from "@/lib/api";
|
||||||
|
import { buildNavCategories } from "@/lib/catalog";
|
||||||
|
import "./globals.css";
|
||||||
|
|
||||||
|
const vazir = Vazirmatn({
|
||||||
|
subsets: ["arabic", "latin"],
|
||||||
|
variable: "--font-vazir",
|
||||||
|
display: "swap",
|
||||||
|
});
|
||||||
|
|
||||||
|
const oswald = Oswald({
|
||||||
|
subsets: ["latin"],
|
||||||
|
variable: "--font-oswald",
|
||||||
|
display: "swap",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
metadataBase: new URL("https://www.sepehrsanaat.com"),
|
||||||
|
title: {
|
||||||
|
default: "سپهر صنعت | تهویه مطبوع، سرمایش و گرمایش",
|
||||||
|
template: "%s | سپهر صنعت",
|
||||||
|
},
|
||||||
|
description:
|
||||||
|
"شرکت فنی مهندسی سپهرصنعت؛ تامین، طراحی و اجرای سیستمهای تهویه مطبوع، سرمایش و گرمایش از سال ۱۳۸۵.",
|
||||||
|
keywords: [
|
||||||
|
"سپهر صنعت",
|
||||||
|
"تهویه مطبوع",
|
||||||
|
"چیلر",
|
||||||
|
"فن کویل",
|
||||||
|
"داکت اسپلیت",
|
||||||
|
"تاسیسات مکانیکی",
|
||||||
|
"قم",
|
||||||
|
],
|
||||||
|
openGraph: {
|
||||||
|
type: "website",
|
||||||
|
locale: "fa_IR",
|
||||||
|
siteName: "سپهر صنعت",
|
||||||
|
title: "سپهر صنعت | تهویه مطبوع، سرمایش و گرمایش",
|
||||||
|
description:
|
||||||
|
"شرکت فنی مهندسی سپهرصنعت؛ تامین، طراحی و اجرای سیستمهای تهویه مطبوع، سرمایش و گرمایش از سال ۱۳۸۵.",
|
||||||
|
url: "https://www.sepehrsanaat.com",
|
||||||
|
images: [{ url: "/images/slider/rooftop.jpg", width: 1200, height: 630, alt: "سپهر صنعت" }],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: "summary_large_image",
|
||||||
|
title: "سپهر صنعت | تهویه مطبوع، سرمایش و گرمایش",
|
||||||
|
description:
|
||||||
|
"شرکت فنی مهندسی سپهرصنعت؛ تامین، طراحی و اجرای سیستمهای تهویه مطبوع، سرمایش و گرمایش از سال ۱۳۸۵.",
|
||||||
|
},
|
||||||
|
robots: { index: true, follow: true },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
const categories = await getProductCategories()
|
||||||
|
.then(buildNavCategories)
|
||||||
|
.catch(() => []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<html
|
||||||
|
lang="fa"
|
||||||
|
dir="rtl"
|
||||||
|
className={`${vazir.variable} ${oswald.variable} h-full antialiased`}
|
||||||
|
>
|
||||||
|
<body className="flex min-h-full flex-col bg-paper text-ink">
|
||||||
|
<script
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: JSON.stringify({
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "HVACBusiness",
|
||||||
|
name: site.name,
|
||||||
|
alternateName: site.nameEn,
|
||||||
|
url: site.url,
|
||||||
|
email: site.emails[0],
|
||||||
|
telephone: "+982537848145",
|
||||||
|
foundingDate: "2006",
|
||||||
|
address: {
|
||||||
|
"@type": "PostalAddress",
|
||||||
|
streetAddress: site.address,
|
||||||
|
addressLocality: "قم",
|
||||||
|
addressCountry: "IR",
|
||||||
|
},
|
||||||
|
sameAs: [site.instagram, site.whatsapp],
|
||||||
|
}),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TopBar />
|
||||||
|
<Header categories={categories} />
|
||||||
|
<main className="flex-1">{children}</main>
|
||||||
|
<Footer categories={categories} />
|
||||||
|
<WhatsappFab />
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "صفحه پیدا نشد",
|
||||||
|
robots: { index: false, follow: false },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function NotFound() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader title="صفحه پیدا نشد" titleEn="NOT FOUND" />
|
||||||
|
<Container className="py-14 text-center">
|
||||||
|
<p className="text-[15px] leading-8 text-muted">
|
||||||
|
صفحهای که دنبال آن هستید وجود ندارد یا منتقل شده است.
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href="/"
|
||||||
|
className="mt-6 inline-flex h-11 items-center rounded-md bg-navy px-5 text-sm font-bold text-white hover:bg-brand"
|
||||||
|
>
|
||||||
|
بازگشت به صفحه اصلی
|
||||||
|
</a>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { HeroSlider } from "@/components/home/HeroSlider";
|
||||||
|
import { Units } from "@/components/home/Units";
|
||||||
|
import { Categories } from "@/components/home/Categories";
|
||||||
|
import { DualBanners } from "@/components/home/DualBanners";
|
||||||
|
import { ProductCarousel } from "@/components/home/ProductCarousel";
|
||||||
|
import { TripleBanners } from "@/components/home/TripleBanners";
|
||||||
|
import { About } from "@/components/home/About";
|
||||||
|
import { BlogCarousel } from "@/components/home/BlogCarousel";
|
||||||
|
import { formatFaDate, getBlogCover, getBlogs, getProductCategories, getProducts, getStoreItems } from "@/lib/api";
|
||||||
|
import { buildNavCategories, mapProductCard, mapStoreItemCard } from "@/lib/catalog";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: { absolute: "سپهر صنعت | تهویه مطبوع، سرمایش و گرمایش" },
|
||||||
|
description:
|
||||||
|
"شرکت فنی مهندسی سپهرصنعت؛ تامین، طراحی و اجرای سیستمهای تهویه مطبوع، سرمایش و گرمایش از سال ۱۳۸۵.",
|
||||||
|
alternates: { canonical: "/" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function Home() {
|
||||||
|
const [store, products, blogs, categoryItems] = await Promise.all([
|
||||||
|
getStoreItems({ pageSize: 12 }),
|
||||||
|
getProducts({ pageSize: 12 }),
|
||||||
|
getBlogs({ pageSize: 6 }),
|
||||||
|
getProductCategories().catch(() => []),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const productCards =
|
||||||
|
store.total > 0 ? store.items.map(mapStoreItemCard) : products.items.map(mapProductCard);
|
||||||
|
|
||||||
|
const posts = blogs.items.map((post) => ({
|
||||||
|
href: `/articles/${post.slug}`,
|
||||||
|
title: post.title,
|
||||||
|
excerpt: post.abstract || "",
|
||||||
|
image: getBlogCover(post),
|
||||||
|
date: formatFaDate(post.publishedAt),
|
||||||
|
}));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="-mt-[74px]">
|
||||||
|
<HeroSlider />
|
||||||
|
</div>
|
||||||
|
<section className="py-6">
|
||||||
|
<Units />
|
||||||
|
</section>
|
||||||
|
<Categories categories={buildNavCategories(categoryItems)} />
|
||||||
|
<DualBanners />
|
||||||
|
<ProductCarousel products={productCards} />
|
||||||
|
<TripleBanners />
|
||||||
|
<About />
|
||||||
|
<BlogCarousel posts={posts} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
import { notFound } from "next/navigation";
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { ProductGrid } from "@/components/catalog/ProductGrid";
|
||||||
|
import { HtmlContent } from "@/components/ui/HtmlContent";
|
||||||
|
import { formatPrice } from "@/lib/format";
|
||||||
|
import {
|
||||||
|
ApiNotFoundError,
|
||||||
|
descendantIds,
|
||||||
|
getProduct,
|
||||||
|
getProductCategories,
|
||||||
|
getProducts,
|
||||||
|
getStoreItemByProduct,
|
||||||
|
productImage,
|
||||||
|
productName,
|
||||||
|
} from "@/lib/api";
|
||||||
|
import { mapProductCard } from "@/lib/catalog";
|
||||||
|
|
||||||
|
type PageProps = { params: Promise<{ slug: string }> };
|
||||||
|
|
||||||
|
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
||||||
|
const { slug } = await params;
|
||||||
|
const categories = await getProductCategories().catch(() => []);
|
||||||
|
const category = categories.find((item) => item.slug === slug);
|
||||||
|
if (category) {
|
||||||
|
const title = category.nameFa || category.name;
|
||||||
|
return {
|
||||||
|
title,
|
||||||
|
description: `${title} | تجهیزات تهویه مطبوع، سرمایش و گرمایش سپهر صنعت`,
|
||||||
|
alternates: { canonical: `/products/${slug}` },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const product = await getProduct(slug);
|
||||||
|
const name = productName(product);
|
||||||
|
return {
|
||||||
|
title: name,
|
||||||
|
description: product.summary || `${name} | سپهر صنعت`,
|
||||||
|
alternates: { canonical: `/products/${slug}` },
|
||||||
|
openGraph: {
|
||||||
|
title: name,
|
||||||
|
images: productImage(product) ? [{ url: productImage(product), alt: name }] : undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return { title: "محصول" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function ProductOrCategoryPage({ params }: PageProps) {
|
||||||
|
const { slug } = await params;
|
||||||
|
const categories = await getProductCategories();
|
||||||
|
const category = categories.find((item) => item.slug === slug);
|
||||||
|
|
||||||
|
if (category) {
|
||||||
|
const ids = new Set(descendantIds(categories, category.id));
|
||||||
|
const { items } = await getProducts({ pageSize: 50 });
|
||||||
|
const filtered = items.filter((item) => item.categoryId && ids.has(String(item.categoryId)));
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title={category.nameFa || category.name}
|
||||||
|
titleEn={category.name}
|
||||||
|
description="تجهیزات تهویه مطبوع، سرمایش و گرمایش سپهر صنعت"
|
||||||
|
/>
|
||||||
|
<Container className="py-10">
|
||||||
|
<ProductGrid products={filtered.map(mapProductCard)} />
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const product = await getProduct(slug);
|
||||||
|
const storeItem = await getStoreItemByProduct(product.id).catch(() => null);
|
||||||
|
const price = storeItem?.salePrice ?? storeItem?.price ?? product.store?.minPrice ?? null;
|
||||||
|
const oldPrice = storeItem?.compareAtPrice ?? storeItem?.originalPrice ?? null;
|
||||||
|
const image = productImage(product);
|
||||||
|
const name = productName(product);
|
||||||
|
const description = product.descriptionHtml || product.summary;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader title={name} titleEn={product.title} />
|
||||||
|
<Container className="py-10">
|
||||||
|
<div className="grid gap-8 lg:grid-cols-[0.9fr_1.1fr]">
|
||||||
|
<div className="overflow-hidden rounded-xl border border-line bg-surface">
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img src={image} alt={name} className="aspect-square w-full object-cover" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{product.categoryNameFa ? (
|
||||||
|
<a
|
||||||
|
href={`/products/${categories.find((c) => c.id === product.categoryId)?.slug ?? ""}`}
|
||||||
|
className="mb-3 inline-block text-sm text-brand"
|
||||||
|
>
|
||||||
|
{product.categoryNameFa}
|
||||||
|
</a>
|
||||||
|
) : null}
|
||||||
|
<p className="text-2xl font-extrabold text-navy">{name}</p>
|
||||||
|
<div className="mt-4">
|
||||||
|
{price != null ? (
|
||||||
|
<p className="text-xl font-extrabold text-brand">{formatPrice(price)}</p>
|
||||||
|
) : (
|
||||||
|
<p className="text-muted">برای استعلام قیمت تماس بگیرید</p>
|
||||||
|
)}
|
||||||
|
{oldPrice && price && oldPrice > price ? (
|
||||||
|
<p className="mt-1 text-sm text-muted line-through">{formatPrice(oldPrice)}</p>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
{description ? (
|
||||||
|
<div className="mt-6 border-t border-line pt-6">
|
||||||
|
<HtmlContent html={description} />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
<a
|
||||||
|
href="/contact"
|
||||||
|
className="mt-8 inline-flex h-11 items-center rounded-md bg-navy px-5 text-sm font-bold text-white hover:bg-brand"
|
||||||
|
>
|
||||||
|
درخواست مشاوره
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof ApiNotFoundError) notFound();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { ProductGrid } from "@/components/catalog/ProductGrid";
|
||||||
|
import { getProducts, getStoreItems } from "@/lib/api";
|
||||||
|
import { mapProductCard, mapStoreItemCard } from "@/lib/catalog";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "محصولات",
|
||||||
|
description: "تجهیزات تهویه مطبوع، سرمایش و گرمایش سپهر صنعت.",
|
||||||
|
alternates: { canonical: "/products" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function ProductsPage({
|
||||||
|
searchParams,
|
||||||
|
}: {
|
||||||
|
searchParams: Promise<{ q?: string }>;
|
||||||
|
}) {
|
||||||
|
const { q } = await searchParams;
|
||||||
|
const store = await getStoreItems({ pageSize: 24, name: q });
|
||||||
|
const products =
|
||||||
|
store.total > 0
|
||||||
|
? store.items.map(mapStoreItemCard)
|
||||||
|
: (await getProducts({ pageSize: 24, name: q })).items.map(mapProductCard);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title="محصولات"
|
||||||
|
titleEn="PRODUCTS"
|
||||||
|
description="تجهیزات تهویه مطبوع، سرمایش و گرمایش سپهر صنعت"
|
||||||
|
/>
|
||||||
|
<Container className="py-10">
|
||||||
|
{q ? (
|
||||||
|
<p className="mb-6 text-sm text-muted">نتایج جستجو برای «{q}»</p>
|
||||||
|
) : null}
|
||||||
|
<ProductGrid products={products} />
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export default function robots(): MetadataRoute.Robots {
|
||||||
|
return {
|
||||||
|
rules: { userAgent: "*", allow: "/" },
|
||||||
|
sitemap: "https://www.sepehrsanaat.com/sitemap.xml",
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import type { MetadataRoute } from "next";
|
||||||
|
import { getBlogs, getProductCategories, getProducts } from "@/lib/api";
|
||||||
|
|
||||||
|
const base = "https://www.sepehrsanaat.com";
|
||||||
|
|
||||||
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
|
const staticRoutes: MetadataRoute.Sitemap = [
|
||||||
|
{ url: base, lastModified: new Date(), changeFrequency: "weekly", priority: 1 },
|
||||||
|
{ url: `${base}/products`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.9 },
|
||||||
|
{ url: `${base}/special-sale`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 },
|
||||||
|
{ url: `${base}/about`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.6 },
|
||||||
|
{ url: `${base}/articles`, lastModified: new Date(), changeFrequency: "weekly", priority: 0.7 },
|
||||||
|
{ url: `${base}/faq`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.4 },
|
||||||
|
{ url: `${base}/contact`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5 },
|
||||||
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [categories, products, blogs] = await Promise.all([
|
||||||
|
getProductCategories(),
|
||||||
|
getProducts({ pageSize: 100 }),
|
||||||
|
getBlogs({ pageSize: 50 }),
|
||||||
|
]);
|
||||||
|
|
||||||
|
const categoryRoutes = categories.map((item) => ({
|
||||||
|
url: `${base}/products/${item.slug}`,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: "weekly" as const,
|
||||||
|
priority: 0.7,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const productRoutes = products.items.map((item) => ({
|
||||||
|
url: `${base}/products/${item.slug}`,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: "weekly" as const,
|
||||||
|
priority: 0.6,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const articleRoutes = blogs.items.map((item) => ({
|
||||||
|
url: `${base}/articles/${item.slug}`,
|
||||||
|
lastModified: item.publishedAt ? new Date(item.publishedAt) : new Date(),
|
||||||
|
changeFrequency: "monthly" as const,
|
||||||
|
priority: 0.5,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const seen = new Set<string>();
|
||||||
|
const unique = [...staticRoutes, ...categoryRoutes, ...productRoutes, ...articleRoutes].filter(
|
||||||
|
(item) => {
|
||||||
|
if (seen.has(item.url)) return false;
|
||||||
|
seen.add(item.url);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return unique;
|
||||||
|
} catch {
|
||||||
|
return staticRoutes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { Metadata } from "next";
|
||||||
|
import { PageHeader } from "@/components/ui/PageHeader";
|
||||||
|
import { Container } from "@/components/ui/Container";
|
||||||
|
import { ProductGrid } from "@/components/catalog/ProductGrid";
|
||||||
|
import { getStoreItems, getStoreSpecials } from "@/lib/api";
|
||||||
|
import { mapStoreItemCard } from "@/lib/catalog";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "فروش ویژه",
|
||||||
|
description: "محصولات جشنواره و تخفیفدار سپهر صنعت.",
|
||||||
|
alternates: { canonical: "/special-sale" },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function SpecialSalePage() {
|
||||||
|
const [festival, specials] = await Promise.all([
|
||||||
|
getStoreItems({ pageSize: 24, isFestival: true }),
|
||||||
|
getStoreSpecials(),
|
||||||
|
]);
|
||||||
|
const items = (festival.items.length ? festival.items : specials).map(mapStoreItemCard);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PageHeader
|
||||||
|
title="فروش ویژه"
|
||||||
|
titleEn="SPECIAL SALE"
|
||||||
|
description="محصولات جشنواره و تخفیفدار سپهر صنعت"
|
||||||
|
/>
|
||||||
|
<Container className="py-10">
|
||||||
|
{items.length ? (
|
||||||
|
<ProductGrid products={items} />
|
||||||
|
) : (
|
||||||
|
<p className="rounded-xl border border-line bg-white px-5 py-12 text-center text-muted">
|
||||||
|
در حال حاضر فروش ویژهای فعال نیست.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 578 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 414 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 418 KiB |
|
After Width: | Height: | Size: 578 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 414 KiB |
|
After Width: | Height: | Size: 578 KiB |
|
After Width: | Height: | Size: 1.0 MiB |