"use client";

import { IMAGE_BASE_URL } from "@/components/main/BaseUrl";

type ShopProductAuthorProps = {
  shopName: string;
  shopLogo?: string | null;
};

export default function ShopProductAuthor({
  shopName,
  shopLogo,
}: ShopProductAuthorProps) {
  return (
    <span className="flex min-w-0 items-center gap-1.5">
      {shopLogo ? (
        // eslint-disable-next-line @next/next/no-img-element
        <img
          src={IMAGE_BASE_URL + shopLogo}
          alt={shopName}
          className="h-8 w-8 shrink-0 rounded-full object-cover"
        />
      ) : (
        <span className="h-8 w-8 shrink-0 rounded-full bg-neutral-300 dark:bg-neutral-700" />
      )}
      <span className="truncate text-xs font-medium text-neutral-600 dark:text-neutral-300">
        {shopName}
      </span>
    </span>
  );
}
