"use client";

import { FC } from "react";
import { Brush } from "lucide-react";
import { displayMobile } from "@/lib/helpers/format.helper";

interface ProfileHeaderProps {
  name: string | null;
  phoneNumber: string;
}

const ProfileHeader: FC<ProfileHeaderProps> = ({ name, phoneNumber }) => {
  const initial = (name ?? "").trim().charAt(0);

  return (
    <div className="relative w-full overflow-hidden bg-paper rounded-b-hero border-b border-line">
      {/* Watercolour washes: blurred pigment spots, decoration only. */}
      <div aria-hidden="true" className="pointer-events-none absolute inset-0">
        <span className="absolute -top-16 -left-10 w-56 h-56 rounded-full bg-ochre/30 blur-3xl" />
        <span className="absolute -top-10 right-[-3rem] w-52 h-52 rounded-full bg-sienna/25 blur-3xl" />
        <span className="absolute bottom-[-5rem] left-1/3 w-64 h-40 rounded-full bg-ultra/15 blur-3xl" />
        <span className="absolute bottom-[-3rem] right-1/4 w-40 h-32 rounded-full bg-sage/20 blur-2xl" />
        <svg className="absolute bottom-3 left-4 w-28 h-10 text-sienna/25" viewBox="0 0 120 40" fill="none">
          <path d="M4 30 C 30 6, 52 38, 78 16 S 112 10, 116 22" stroke="currentColor" strokeWidth="6" strokeLinecap="round" />
        </svg>
      </div>

      <div className="relative flex flex-col items-center pt-8 pb-6 px-4">
        <span className="w-20 h-20 rounded-full bg-canvas ring-4 ring-canvas/70 shadow-raised grid place-items-center text-display font-extrabold text-sienna-dark">
          {initial || <Brush className="w-8 h-8" aria-hidden="true" />}
        </span>

        <h1 className="text-title-2 font-extrabold mt-3">{name || "هنرجوی رنگوک"}</h1>
        <p className="text-body text-ink-soft mt-0.5 tabular-nums" dir="ltr">{displayMobile(phoneNumber)}</p>
      </div>
    </div>
  );
};

export default ProfileHeader;
