Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

1.1 KB
Raw Blame
import { StarRating } from '@/components/atoms/StarRating/StarRating';
import { SellerAvatar } from "@/components/cells/SellerAvatar/SellerAvatar"
import { CollapseIcon } from "@/icons"
import clsx from "clsx"

export const SellerInfoHeader = ({
  photo,
  name,
  rating = 0,
  reviewCount = 0,
  showArrow,
  bottomBorder = false,
  showReviews = true,
}: {
  photo: string
  name: string
  rating?: number
  reviewCount?: number
  showArrow: boolean
  bottomBorder?: boolean
  showReviews?: boolean
}) => (
  <div
    className={clsx(
      "flex gap-4 w-full p-5 items-center",
      bottomBorder && "border-b"
    )}
  >
    <div className="rounded-sm">
      <SellerAvatar photo={photo} size={56} alt={name} />
    </div>
    <div className="flex flex-col gap-1">
      <h3 className="heading-sm text-primary">{name}</h3>
      {showReviews && (
        <div className="flex items-center gap-2">
          <StarRating starSize={14} rate={rating || 0} />
          <span className="label-md text-secondary">{reviewCount} reviews</span>
        </div>
      )}
    </div>
    {showArrow && <CollapseIcon className="ml-auto -rotate-90" />}
  </div>
)