صفحهٔ ۴۰۴
پیشنمایش تمامصفحهصفحهٔ پیدا نشد با تصویرِ خطیِ تابلوی آویزانِ ۴۰۴ (هماهنگ با حالتِ تیره) و راه بازگشت.
۱. نصب کامپوننتها
این بلاک از ۳ آیتم دیگ استفاده میکند: buttoncontrol-sizelink
npx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/link.jsonpnpm dlx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/link.jsonyarn dlx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/link.jsonbunx --bun digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/link.jsonnpx digdesign@latest add button control-size link --framework vuepnpm dlx digdesign@latest add button control-size link --framework vueyarn dlx digdesign@latest add button control-size link --framework vuebunx --bun digdesign@latest add button control-size link --framework vuenpx digdesign@latest add button --framework sveltepnpm dlx digdesign@latest add button --framework svelteyarn dlx digdesign@latest add button --framework sveltebunx --bun digdesign@latest add button --framework sveltenpx digdesign@latest add button control-size link --framework angularpnpm dlx digdesign@latest add button control-size link --framework angularyarn dlx digdesign@latest add button control-size link --framework angularbunx --bun digdesign@latest add button control-size link --framework angularnpx digdesign@latest add button control-size link --framework androidpnpm dlx digdesign@latest add button control-size link --framework androidyarn dlx digdesign@latest add button control-size link --framework androidbunx --bun digdesign@latest add button control-size link --framework android۲. کد صفحه
کد را در صفحهٔ پروژهتان بگذارید (React: app/<route>/page.tsx) و متنها، داده و هندلرها را با محصول خودتان عوض کنید. با سوییچر فریمورک کدِ همین صفحه در فریمورک دیگر را ببینید.
"use client"
import NextLink from "next/link"
import { Button } from "@/components/ui/button"
import { ControlSizeProvider } from "@/components/ui/control-size"
import { Link } from "@/components/ui/link"
/**
* تصویرِ خطی تابلوی آویزان؛ فقط رنگِ متن و پسزمینهٔ تم، پس در حالتِ تیره هم درست است.
*/
function HangingSign({ className }: { className?: string }) {
return (
<svg viewBox="0 0 300 250" role="img" aria-label="تابلوی آویزانِ ۴۰۴" className={className}>
{/* میخ و دو بند */}
<path d="M150 30 96 109M150 30l62 79" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" />
<circle cx="150" cy="26" r="6" fill="var(--background)" stroke="currentColor" strokeWidth="2" />
<path d="M150 20v-8" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
<g>
{/* عمقِ تابلو: لایهٔ پشتی با فاصله، مثلِ برشهای خطی نمونه */}
<path d="M58 114h200v122H58z" transform="translate(8 7)" fill="var(--background)" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" />
<path d="M258 114l8 7v122l-8-7M58 236l8 7h200" fill="none" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" />
{/* بدنهٔ پنجره */}
<rect x="50" y="108" width="208" height="126" fill="var(--background)" stroke="currentColor" strokeWidth="2" />
<path d="M50 128h208" stroke="currentColor" strokeWidth="2" />
{/* سربرگ: منو و دو دایره، و حلقههای بند */}
<path d="M60 114h10M60 118h10M60 122h10" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" />
<circle cx="236" cy="118" r="2.6" fill="none" stroke="currentColor" strokeWidth="1.6" />
<circle cx="246" cy="118" r="2.6" fill="none" stroke="currentColor" strokeWidth="1.6" />
<circle cx="96" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" strokeWidth="1.75" />
<circle cx="212" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" strokeWidth="1.75" />
<rect x="56" y="134" width="196" height="94" fill="currentColor" />
<text x="154" y="198" textAnchor="middle" fontSize="54" fontWeight="800" fill="var(--background)">۴۰۴</text>
</g>
</svg>
)
}
/** صفحهٔ ۴۰۴؛ در Next.js همین را در app/not-found.tsx بگذارید. */
export default function NotFoundBlock() {
return (
<ControlSizeProvider size="xl" asChild>
<main className="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center">
<HangingSign className="w-64 max-w-full text-foreground sm:w-80" />
<div className="flex max-w-md flex-col items-center gap-3">
<h1 className="text-3xl leading-snug font-bold">اِ… انگار گم شدیم!</h1>
<p className="leading-7 text-muted-foreground">
این صفحه رو پیدا نکردیم. شاید آدرس یه کم اشتباه تایپ شده، یا صفحه جاش عوض شده.
</p>
</div>
<div className="flex flex-wrap justify-center gap-3">
<Button asChild>
<NextLink href="/">برگردیم خونه</NextLink>
</Button>
<Button asChild variant="outline">
<NextLink href="/help">مرکز راهنما</NextLink>
</Button>
</div>
<p className="text-sm text-muted-foreground">
فکر میکنی تقصیر ماست؟ <Link href="/support">بهمون بگو</Link>.
</p>
</main>
</ControlSizeProvider>
)
}
<script setup lang="ts">
import Button from "@/components/ui/Button.vue"
import ControlSize from "@/components/ui/ControlSize.vue"
import Link from "@/components/ui/Link.vue"
/** صفحهٔ ۴۰۴؛ در Vue Router همین را برای مسیرِ `*` بگذارید. */
</script>
<template>
<ControlSize size="xl" as-child>
<main class="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center">
<svg viewBox="0 0 300 250" role="img" aria-label="تابلوی آویزانِ ۴۰۴" class="w-64 max-w-full text-foreground sm:w-80">
<path d="M150 30 96 109M150 30l62 79" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" />
<circle cx="150" cy="26" r="6" fill="var(--background)" stroke="currentColor" stroke-width="2" />
<path d="M150 20v-8" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
<g>
<path d="M58 114h200v122H58z" transform="translate(8 7)" fill="var(--background)" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
<path d="M258 114l8 7v122l-8-7M58 236l8 7h200" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
<rect x="50" y="108" width="208" height="126" fill="var(--background)" stroke="currentColor" stroke-width="2" />
<path d="M50 128h208" stroke="currentColor" stroke-width="2" />
<path d="M60 114h10M60 118h10M60 122h10" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" />
<circle cx="236" cy="118" r="2.6" fill="none" stroke="currentColor" stroke-width="1.6" />
<circle cx="246" cy="118" r="2.6" fill="none" stroke="currentColor" stroke-width="1.6" />
<circle cx="96" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" stroke-width="1.75" />
<circle cx="212" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" stroke-width="1.75" />
<rect x="56" y="134" width="196" height="94" fill="currentColor" />
<text x="154" y="198" text-anchor="middle" font-size="54" font-weight="800" fill="var(--background)">۴۰۴</text>
</g>
</svg>
<div class="flex max-w-md flex-col items-center gap-3">
<h1 class="text-3xl leading-snug font-bold">اِ… انگار گم شدیم!</h1>
<p class="leading-7 text-muted-foreground">
این صفحه رو پیدا نکردیم. شاید آدرس یه کم اشتباه تایپ شده، یا صفحه جاش عوض شده.
</p>
</div>
<div class="flex flex-wrap justify-center gap-3">
<Button as-child>
<a href="/">برگردیم خونه</a>
</Button>
<Button as-child variant="outline">
<a href="/help">مرکز راهنما</a>
</Button>
</div>
<p class="text-sm text-muted-foreground">
فکر میکنی تقصیر ماست؟ <Link href="/support">بهمون بگو</Link>.
</p>
</main>
</ControlSize>
</template>
کدِ این بلاک هنوز برای Svelte نوشته نشده است.
این موارد هنوز برای Svelte آماده نیستند: control-sizelink
کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="svelte" ایجنت آن را با کامپوننتهای Svelte میسازد.
import { ChangeDetectionStrategy, Component } from "@angular/core"
import { DigButton } from "@/components/ui/button"
import { DigControlSize } from "@/components/ui/control-size"
import { DigLink } from "@/components/ui/link"
@Component({
selector: "dig-block-not-found",
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [DigButton, DigControlSize, DigLink],
template: `
<main
digControlSize="xl"
class="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center"
>
<svg
viewBox="0 0 300 250"
role="img"
aria-label="تابلوی آویزانِ ۴۰۴"
class="w-64 max-w-full text-foreground sm:w-80"
>
<path
d="M150 30 96 109M150 30l62 79"
fill="none"
stroke="currentColor"
strokeWidth="1.75"
strokeLinecap="round"
></path>
<circle
cx="150"
cy="26"
r="6"
fill="var(--background)"
stroke="currentColor"
strokeWidth="2"
></circle>
<path
d="M150 20v-8"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
></path>
<g>
<path
d="M58 114h200v122H58z"
transform="translate(8 7)"
fill="var(--background)"
stroke="currentColor"
strokeWidth="2"
strokeLinejoin="round"
></path>
<path
d="M258 114l8 7v122l-8-7M58 236l8 7h200"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinejoin="round"
></path>
<rect
x="50"
y="108"
width="208"
height="126"
fill="var(--background)"
stroke="currentColor"
strokeWidth="2"
></rect>
<path d="M50 128h208" stroke="currentColor" strokeWidth="2"></path>
<path
d="M60 114h10M60 118h10M60 122h10"
stroke="currentColor"
strokeWidth="1.75"
strokeLinecap="round"
></path>
<circle
cx="236"
cy="118"
r="2.6"
fill="none"
stroke="currentColor"
strokeWidth="1.6"
></circle>
<circle
cx="246"
cy="118"
r="2.6"
fill="none"
stroke="currentColor"
strokeWidth="1.6"
></circle>
<circle
cx="96"
cy="112"
r="3.2"
fill="var(--background)"
stroke="currentColor"
strokeWidth="1.75"
></circle>
<circle
cx="212"
cy="112"
r="3.2"
fill="var(--background)"
stroke="currentColor"
strokeWidth="1.75"
></circle>
<rect
x="56"
y="134"
width="196"
height="94"
fill="currentColor"
></rect>
<text
x="154"
y="198"
textAnchor="middle"
fontSize="54"
fontWeight="800"
fill="var(--background)"
>
۴۰۴
</text>
</g>
</svg>
<div class="flex max-w-md flex-col items-center gap-3">
<h1 class="text-3xl leading-snug font-bold">اِ… انگار گم شدیم!</h1>
<p class="leading-7 text-muted-foreground">
این صفحه رو پیدا نکردیم. شاید آدرس یه کم اشتباه تایپ شده، یا صفحه جاش
عوض شده.
</p>
</div>
<div class="flex flex-wrap justify-center gap-3">
<a digButton href="/">برگردیم خونه</a>
<a digButton variant="outline" href="/help">مرکز راهنما</a>
</div>
<p class="text-sm text-muted-foreground">
فکر میکنی تقصیر ماست؟ <a digLink href="/support">بهمون بگو</a>.
</p>
</main>
`,
})
export class NotFoundBlock {}
کدِ این بلاک هنوز برای Android نوشته نشده است.
همهٔ کامپوننتهای لازم برای Android آمادهاند؛ با MCP میتوانید همین صفحه را از روی نسخهٔ React بسازید.
کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="android" ایجنت آن را با کامپوننتهای Android میسازد.