feat: implement PosterLight component and enhance SiteLogo functionality for improved poster rendering

This commit is contained in:
hamed
2026-07-04 23:02:20 +03:30
parent 39c09bfcd5
commit 522caf6b1b
5 changed files with 290 additions and 32 deletions
+8 -29
View File
@@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import DoctorAvatar from "@/app/component/DoctorAvatar";
import QrImg from "./QrImg";
import SiteLogoBase from "./SiteLogo";
import { getStateInfoClient } from "@/lib/getStateInfoClient";
import StarDI from "@/components/icons/StarDI";
@@ -15,34 +16,8 @@ import Whatsapp from "@/components/icons/Whatsapp";
const POSTER_BG =
"linear-gradient(160deg, #0B2A4A 0%, #16528C 52%, #2E77C4 100%)";
function SiteLogo({ city, className }) {
if (city?.logo_url) {
return (
<img
src={city.logo_url}
alt="logo"
crossOrigin="anonymous"
className={`object-contain ${className}`}
/>
);
}
return (
<svg
viewBox="0 0 100 100"
className={className}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M50 12 A38 38 0 1 0 88 50 A19 19 0 0 0 55.6 36.6"
fill="none"
stroke="#8FB6FF"
strokeWidth="7.5"
strokeLinecap="round"
/>
<rect x="46.5" y="40" width="7" height="20" rx="3.5" fill="#FF8848" />
<rect x="40" y="46.5" width="20" height="7" rx="3.5" fill="#FF8848" />
</svg>
);
function SiteLogo(props) {
return <SiteLogoBase stroke="#8FB6FF" {...props} />;
}
function SectionTitle({ icon, children }) {
@@ -68,7 +43,11 @@ function Poster({ data, onQrReady }) {
const services = (data?.expertise ?? []).filter((s) => s?.name);
const shownServices = services.slice(0, 8);
const moreServices = services.length - shownServices.length;
const address = data?.address?.[0]?.address;
const rawAddress = data?.address?.[0]?.address;
const address =
rawAddress && rawAddress.length > 120
? `${rawAddress.slice(0, 120).trimEnd()}`
: rawAddress;
const phones = (data?.address ?? [])
.map((a) => a?.phone)
.filter(Boolean)