326 lines
15 KiB
JavaScript
326 lines
15 KiB
JavaScript
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
import { q as queryParams, h as home, d as contact, e as about, f as artOfWeaving, g as faq, B as Button, i as bespoke } from "./index-CY6fYws-.js";
|
|
import { I as Input } from "./input-DfkIsvXR.js";
|
|
import { L as Label } from "./label-DrpjkvJN.js";
|
|
import { usePage, Link, router } from "@inertiajs/react";
|
|
import { SiFacebook, SiInstagram } from "@icons-pack/react-simple-icons";
|
|
import { MoveRight, Phone, Mail, MapPin, Menu } from "lucide-react";
|
|
import { S as Select, a as SelectTrigger, b as SelectValue, c as SelectContent, e as SelectGroup, d as SelectItem } from "./select-CsRyyQUa.js";
|
|
import { S as Sheet, a as SheetTrigger, b as SheetContent, c as SheetTitle, d as SheetDescription } from "./sheet-Bq2cyJmx.js";
|
|
const product = (options) => ({
|
|
url: product.url(options),
|
|
method: "get"
|
|
});
|
|
product.definition = {
|
|
methods: ["get", "head"],
|
|
url: "/product"
|
|
};
|
|
product.url = (options) => {
|
|
return product.definition.url + queryParams(options);
|
|
};
|
|
product.get = (options) => ({
|
|
url: product.url(options),
|
|
method: "get"
|
|
});
|
|
product.head = (options) => ({
|
|
url: product.url(options),
|
|
method: "head"
|
|
});
|
|
const productForm = (options) => ({
|
|
action: product.url(options),
|
|
method: "get"
|
|
});
|
|
productForm.get = (options) => ({
|
|
action: product.url(options),
|
|
method: "get"
|
|
});
|
|
productForm.head = (options) => ({
|
|
action: product.url({
|
|
[options?.mergeQuery ? "mergeQuery" : "query"]: {
|
|
_method: "HEAD",
|
|
...options?.query ?? options?.mergeQuery ?? {}
|
|
}
|
|
}),
|
|
method: "get"
|
|
});
|
|
product.form = productForm;
|
|
const index = {
|
|
product: Object.assign(product, product)
|
|
};
|
|
function t(translations, key, replacements = {}) {
|
|
if (!translations) {
|
|
console.warn("No translations provided");
|
|
return key;
|
|
}
|
|
const keys = key.split(".");
|
|
let value = translations;
|
|
for (const k of keys) {
|
|
if (value && typeof value === "object" && k in value) {
|
|
value = value[k];
|
|
} else {
|
|
console.warn(`Translation key not found: ${key}`);
|
|
return key;
|
|
}
|
|
}
|
|
if (typeof value !== "string") {
|
|
return key;
|
|
}
|
|
let text = value;
|
|
Object.entries(replacements).forEach(([k, v]) => {
|
|
text = text.replace(new RegExp(`:${k}`, "g"), v);
|
|
});
|
|
return text;
|
|
}
|
|
function useTranslations() {
|
|
const { translations } = usePage().props;
|
|
const translate = (key, replacements = {}) => {
|
|
return t(translations, key, replacements);
|
|
};
|
|
return { t: translate, translations };
|
|
}
|
|
function useLocale() {
|
|
const { locale } = usePage().props;
|
|
return locale;
|
|
}
|
|
const ns = "/build/assets/ns-CsWIdWF7.gif";
|
|
const oko = "/build/assets/oko-BkZT_kDH.gif";
|
|
const logo = "/build/assets/soorya-Ci0dhsli.png";
|
|
function Footer() {
|
|
const { t: t2 } = useTranslations();
|
|
return /* @__PURE__ */ jsxs("footer", { className: "bg-primary", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "mx-auto grid max-w-screen-2xl grid-cols-4 gap-8 px-12 py-8 max-md:grid-cols-1 max-md:grid-rows-4 max-md:px-6", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
/* @__PURE__ */ jsx("img", { src: logo, alt: "Soorya Carpet Logo", className: "w-32" }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 text-sm text-white", children: [
|
|
/* @__PURE__ */ jsx("p", { children: t2("footer.desc.title") }),
|
|
/* @__PURE__ */ jsxs("ul", { children: [
|
|
/* @__PURE__ */ jsx("li", { children: t2("footer.desc.company") }),
|
|
/* @__PURE__ */ jsx("li", { children: t2("footer.desc.address") }),
|
|
/* @__PURE__ */ jsx("li", { children: t2("footer.desc.phone") }),
|
|
/* @__PURE__ */ jsx("li", { children: t2("footer.desc.email") })
|
|
] })
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium text-white", children: "Quick Link" }),
|
|
/* @__PURE__ */ jsxs("ul", { className: "flex flex-col gap-1 text-sm", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: home(), className: "text-neutral-300", children: t2("footer.links.home") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: contact(), className: "text-neutral-300", children: t2("footer.links.contact") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: about(), className: "text-neutral-300", children: t2("footer.links.about-us") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: artOfWeaving(),
|
|
className: "text-neutral-300",
|
|
children: t2("footer.links.art")
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: index.product(),
|
|
className: "text-neutral-300",
|
|
children: t2("footer.links.products")
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: home(), className: "text-neutral-300", children: t2("footer.links.bespoke") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: home(), className: "text-neutral-300", children: t2("footer.links.gallery") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: faq(), className: "text-neutral-300", children: t2("footer.links.faq") }) })
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium text-white", children: "Certifications & Trust Badges" }),
|
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-1", children: [
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: ns,
|
|
alt: "NS Standard",
|
|
className: "aspect-square object-cover object-center"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: oko,
|
|
alt: "oko Standard",
|
|
className: "object-cover object-center"
|
|
}
|
|
)
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
/* @__PURE__ */ jsxs("form", { className: "flex flex-col gap-2", children: [
|
|
/* @__PURE__ */ jsx(Label, { className: "text-lg font-medium text-white", children: t2("footer.news.title") }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 max-sm:flex-col", children: [
|
|
/* @__PURE__ */ jsx(
|
|
Input,
|
|
{
|
|
id: "newsletter",
|
|
placeholder: t2("footer.news.input"),
|
|
className: "bg-white"
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsxs(
|
|
Button,
|
|
{
|
|
variant: "outline",
|
|
className: "bg-transparent text-white max-sm:w-full",
|
|
children: [
|
|
t2("footer.news.button"),
|
|
" ",
|
|
/* @__PURE__ */ jsx(MoveRight, {})
|
|
]
|
|
}
|
|
)
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
/* @__PURE__ */ jsx("p", { className: "text-base font-medium text-white", children: t2("footer.news.legal.title") }),
|
|
/* @__PURE__ */ jsxs("ul", { className: "flex flex-col gap-1 text-sm text-neutral-300", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "privacy-policy", children: t2("footer.news.legal.privacy") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: "terms-and-condition", children: t2("footer.news.legal.terms") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: faq(), children: t2("footer.news.legal.policy") }) })
|
|
] })
|
|
] })
|
|
] }) })
|
|
] }),
|
|
/* @__PURE__ */ jsx("hr", { className: "mx-auto my-4 max-w-screen-2xl border-neutral-500 px-12" }),
|
|
/* @__PURE__ */ jsxs("div", { className: "max-auto flex max-w-screen-2xl items-center justify-between px-12 py-4 max-md:flex-col max-md:gap-4 max-md:px-6", children: [
|
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-white", children: [
|
|
"© ",
|
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
" Soorya Carpet Industries. All rights reserved."
|
|
] }),
|
|
/* @__PURE__ */ jsxs("ul", { className: "flex items-center gap-4", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: "https://www.facebook.com/sooryacarpet/?locale=ne_NP",
|
|
target: "_blank",
|
|
children: /* @__PURE__ */ jsx(SiFacebook, { color: "#d4d4d4", size: 16 })
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: "https://www.instagram.com/kaleen_carpet/",
|
|
target: "_blank",
|
|
children: /* @__PURE__ */ jsx(SiInstagram, { color: "#d4d4d4", size: 16 })
|
|
}
|
|
) })
|
|
] })
|
|
] })
|
|
] });
|
|
}
|
|
function Navbar() {
|
|
const { t: t2 } = useTranslations();
|
|
const locale = useLocale();
|
|
const changeLanguage = (newLocale) => {
|
|
router.post(
|
|
"/locale",
|
|
{ locale: newLocale },
|
|
{
|
|
preserveScroll: true,
|
|
preserveState: true,
|
|
onSuccess: () => {
|
|
console.log("Language changed to:", newLocale);
|
|
}
|
|
}
|
|
);
|
|
};
|
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("header", { className: "mx-auto w-full text-sm not-has-[nav]:hidden", children: [
|
|
/* @__PURE__ */ jsx("div", { className: "bg-primary py-1.5 text-white/60 max-md:hidden", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-screen-2xl items-center justify-between px-12 max-md:px-2", children: [
|
|
/* @__PURE__ */ jsxs("ul", { className: "flex items-center gap-4", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
"a",
|
|
{
|
|
href: "tel:01-4220087",
|
|
className: "flex items-center gap-1 text-xs",
|
|
children: [
|
|
/* @__PURE__ */ jsx(Phone, { size: 14 }),
|
|
"01-4220087"
|
|
]
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
"a",
|
|
{
|
|
href: "mailto:info@soorya.com",
|
|
className: "flex items-center gap-1 text-xs",
|
|
children: [
|
|
/* @__PURE__ */ jsx(Mail, { size: 14 }),
|
|
"info@soorya.com"
|
|
]
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
"a",
|
|
{
|
|
href: "#",
|
|
className: "flex items-center gap-1 text-xs",
|
|
children: [
|
|
/* @__PURE__ */ jsx(MapPin, { size: 14 }),
|
|
"Thapathali, Kathmandu, Nepal"
|
|
]
|
|
}
|
|
) })
|
|
] }),
|
|
/* @__PURE__ */ jsxs(Select, { value: locale, onValueChange: changeLanguage, children: [
|
|
/* @__PURE__ */ jsx(SelectTrigger, { className: "h-0 w-32 border-0 focus-visible:ring-0", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
/* @__PURE__ */ jsx(SelectItem, { value: "en", children: "English" }),
|
|
/* @__PURE__ */ jsx(SelectItem, { value: "cn", children: "中国人" })
|
|
] }) })
|
|
] })
|
|
] }) }),
|
|
/* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-screen-2xl px-12 py-2 text-base not-has-[nav]:hidden max-md:px-4", children: /* @__PURE__ */ jsxs("nav", { className: "flex items-center justify-between gap-2", children: [
|
|
/* @__PURE__ */ jsx(Link, { href: home(), children: /* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: logo,
|
|
alt: "Soorya Carpet Logo",
|
|
className: "w-36"
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsxs("ul", { className: "flex items-center gap-6 max-md:hidden", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: about(), children: t2("nav.about-us") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: artOfWeaving(), children: t2("nav.art") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: index.product(), children: t2("nav.products") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: bespoke(), children: t2("nav.bespoke") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: faq(), children: t2("nav.faq") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: contact(), children: t2("nav.contact") }) })
|
|
] }),
|
|
/* @__PURE__ */ jsxs(Sheet, { children: [
|
|
/* @__PURE__ */ jsx(SheetTrigger, { className: "md:hidden", children: /* @__PURE__ */ jsx(Menu, { size: 24 }) }),
|
|
/* @__PURE__ */ jsxs(SheetContent, { className: "w-full", children: [
|
|
/* @__PURE__ */ jsx(SheetTitle, { className: "hidden", children: "Menu" }),
|
|
/* @__PURE__ */ jsx(SheetDescription, { className: "hidden", children: "Navigation Menu Item" }),
|
|
/* @__PURE__ */ jsxs("ul", { className: "mt-20 flex flex-col items-center justify-center gap-6", children: [
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: about(), children: t2("nav.about-us") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: artOfWeaving(), children: t2("nav.art") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: index.product(), children: t2("nav.products") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: bespoke(), children: t2("nav.bespoke") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: faq(), children: t2("nav.faq") }) }),
|
|
/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: contact(), children: t2("nav.contact") }) })
|
|
] })
|
|
] })
|
|
] })
|
|
] }) })
|
|
] }) });
|
|
}
|
|
function Layout({ children }) {
|
|
return /* @__PURE__ */ jsxs("div", { className: "mx-auto grid min-h-[100dvh] grid-rows-[auto_1fr_auto]", children: [
|
|
/* @__PURE__ */ jsx(Navbar, {}),
|
|
/* @__PURE__ */ jsx("main", { children }),
|
|
/* @__PURE__ */ jsx(Footer, {})
|
|
] });
|
|
}
|
|
export {
|
|
Layout as L,
|
|
index as i,
|
|
ns as n,
|
|
oko as o,
|
|
useTranslations as u
|
|
};
|