{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "customer-reviews",
  "title": "Customer Reviews",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/customer-reviews/CustomerReviews.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { CheckCircle2, Image as ImageIcon, PenLine, Star, ThumbsUp, X } from 'lucide-react'\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card } from '@/components/ui/card'\nimport { Progress } from '@/components/ui/progress'\nimport { Rating } from '@/components/ui/rating'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'\nimport { cn } from '@/lib/utils'\n\nexport interface ReviewItem {\n  id: string\n  author: string\n  initials: string\n  avatar?: string\n  rating: number\n  date: string\n  title: string\n  body: string\n  variant: string\n  verified: boolean\n  helpfulCount: number\n  isHelpful?: boolean\n  photos?: string[]\n}\n\ninterface RatingBar {\n  stars: number\n  percentage: number\n  count: number\n}\n\ninterface PhotoGalleryItem {\n  id: string\n  url: string\n  alt: string\n  author: string\n}\n\nconst ratingBreakdowns: RatingBar[] = [\n  { stars: 5, percentage: 78, count: 267 },\n  { stars: 4, percentage: 14, count: 48 },\n  { stars: 3, percentage: 5, count: 17 },\n  { stars: 2, percentage: 2, count: 7 },\n  { stars: 1, percentage: 1, count: 3 },\n]\n\nconst customerPhotos: PhotoGalleryItem[] = [\n  {\n    id: 'p1',\n    url: 'https://images.unsplash.com/photo-1546435770-a3e426bf472b?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of matte navy headphones on wood desk',\n    author: 'Marcus V.',\n  },\n  {\n    id: 'p2',\n    url: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of headphones studio unboxing',\n    author: 'Elena R.',\n  },\n  {\n    id: 'p3',\n    url: 'https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of cushioned earpads close up',\n    author: 'Devon C.',\n  },\n  {\n    id: 'p4',\n    url: 'https://images.unsplash.com/photo-1583394838336-acd977736f90?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo wearing headphones in coffee shop',\n    author: 'Amara D.',\n  },\n  {\n    id: 'p5',\n    url: 'https://images.unsplash.com/photo-1590658268037-6bf12165a8df?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo of travel case and cable accessories',\n    author: 'Liam G.',\n  },\n  {\n    id: 'p6',\n    url: 'https://images.unsplash.com/photo-1545127398-14699f92334b?w=400&auto=format&fit=crop&q=80',\n    alt: 'Customer photo wearing silver headphones while working',\n    author: 'Sophia M.',\n  },\n]\n\nconst initialReviews: ReviewItem[] = [\n  {\n    id: 'rev-1',\n    author: 'Marcus Vance',\n    initials: 'MV',\n    avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '2 days ago',\n    title: 'Exceeded all my expectations — best studio acoustic fidelity',\n    body: 'The soundstage is remarkably wide and bass response is tight without overpowering the mids. Build quality is aerospace-grade, and the memory foam ear cushions remain comfortable even through 8-hour mixing sessions. Multi-device Bluetooth pairing switches directly between MacBook and phone.',\n    variant: 'Color: Matte Navy · Size: L',\n    verified: true,\n    helpfulCount: 24,\n    isHelpful: false,\n    photos: [\n      'https://images.unsplash.com/photo-1546435770-a3e426bf472b?w=400&auto=format&fit=crop&q=80',\n      'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&auto=format&fit=crop&q=80',\n    ],\n  },\n  {\n    id: 'rev-2',\n    author: 'Elena Rostova',\n    initials: 'ER',\n    avatar: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '1 week ago',\n    title: 'ANC handles subway roar with zero pressure sensation',\n    body: 'Active noise cancellation on these is sublime. Unlike other flagships that create an uncomfortable eardrum suction pressure, this feels completely natural. Battery life easily stretches across 4 days of heavy commuting without a recharge.',\n    variant: 'Color: Silver Frost · Size: M',\n    verified: true,\n    helpfulCount: 19,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1583394838336-acd977736f90?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-3',\n    author: 'Devon Chen',\n    initials: 'DC',\n    avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&auto=format&fit=crop&q=80',\n    rating: 4,\n    date: '2 weeks ago',\n    title: 'Fantastic sound and ergonomics, case could be slightly slimmer',\n    body: 'Everything about audio reproduction is 10/10. The companion app EQ presets are actually tuned well instead of gimmicky. Only minor critique is the hard-shell travel case is a bit bulky for slim laptop bags, but the protection is undisputed.',\n    variant: 'Color: Matte Navy · Size: L',\n    verified: true,\n    helpfulCount: 12,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1484704849700-f032a568e944?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-4',\n    author: 'Amara Diallo',\n    initials: 'AD',\n    avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '3 weeks ago',\n    title: 'Crystal-clear microphone quality for all-day client calls',\n    body: 'I purchased these primarily for conference calls in a busy open-plan studio. The beamforming microphones filter out nearby background conversations so callers only hear my voice. Lightweight headband design does not induce fatigue.',\n    variant: 'Color: Space Black · Size: L',\n    verified: true,\n    helpfulCount: 8,\n    isHelpful: false,\n  },\n]\n\nconst extraReviews: ReviewItem[] = [\n  {\n    id: 'rev-5',\n    author: 'Liam Gallagher',\n    initials: 'LG',\n    avatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=160&auto=format&fit=crop&q=80',\n    rating: 5,\n    date: '1 month ago',\n    title: 'Premium finish that justifies every single penny',\n    body: 'The anodized aluminum arms and tactile physical dials feel so much better than finicky touch controls in cold weather. Fast USB-C charging gave me 6 hours of playback from a 15-minute coffee break charge.',\n    variant: 'Color: Space Black · Size: L',\n    verified: true,\n    helpfulCount: 15,\n    isHelpful: false,\n    photos: ['https://images.unsplash.com/photo-1590658268037-6bf12165a8df?w=400&auto=format&fit=crop&q=80'],\n  },\n  {\n    id: 'rev-6',\n    author: 'Sophia Martinez',\n    initials: 'SM',\n    avatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=160&auto=format&fit=crop&q=80',\n    rating: 4,\n    date: '1 month ago',\n    title: 'Great balanced frequency response for classical and jazz',\n    body: 'Instruments have pinpoint positional separation in spatial mode. The high frequencies are crisp without ever becoming sibilant or harsh at high volume.',\n    variant: 'Color: Silver Frost · Size: M',\n    verified: false,\n    helpfulCount: 6,\n    isHelpful: false,\n  },\n]\n\nexport function CustomerReviews() {\n  const [reviews, setReviews] = React.useState<ReviewItem[]>(initialReviews)\n  const [selectedRating, setSelectedRating] = React.useState<number | null>(null)\n  const [withPhotosOnly, setWithPhotosOnly] = React.useState(false)\n  const [verifiedOnly, setVerifiedOnly] = React.useState(false)\n  const [sortBy, setSortBy] = React.useState<'recent' | 'highest' | 'lowest' | 'helpful'>('recent')\n  const [isWritingReview, setIsWritingReview] = React.useState(false)\n  const [hasLoadedMore, setHasLoadedMore] = React.useState(false)\n  const [activePhotoUrl, setActivePhotoUrl] = React.useState<string | null>(null)\n\n  // Write review form states\n  const [newRating, setNewRating] = React.useState(5)\n  const [newAuthor, setNewAuthor] = React.useState('')\n  const [newVariant, setNewVariant] = React.useState('Color: Matte Navy · Size: L')\n  const [newTitle, setNewTitle] = React.useState('')\n  const [newBody, setNewBody] = React.useState('')\n\n  function toggleRatingFilter(stars: number) {\n    setSelectedRating((prev) => (prev === stars ? null : stars))\n  }\n\n  function resetFilters() {\n    setSelectedRating(null)\n    setWithPhotosOnly(false)\n    setVerifiedOnly(false)\n  }\n\n  function toggleHelpful(reviewId: string) {\n    setReviews((prev) =>\n      prev.map((rev) => {\n        if (rev.id === reviewId) {\n          const nextIsHelpful = !rev.isHelpful\n          return {\n            ...rev,\n            isHelpful: nextIsHelpful,\n            helpfulCount: nextIsHelpful ? rev.helpfulCount + 1 : rev.helpfulCount - 1,\n          }\n        }\n        return rev\n      }),\n    )\n  }\n\n  function loadMore() {\n    setReviews((prev) => [...prev, ...extraReviews])\n    setHasLoadedMore(true)\n  }\n\n  function submitReview() {\n    if (!newTitle.trim() || !newBody.trim() || newRating === 0) return\n    const authorName = newAuthor.trim() || 'Anonymous User'\n    const initials = authorName\n      .split(' ')\n      .map((n) => n[0])\n      .join('')\n      .toUpperCase()\n      .slice(0, 2)\n\n    const created: ReviewItem = {\n      id: `rev-${Date.now()}`,\n      author: authorName,\n      initials,\n      rating: newRating,\n      date: 'Just now',\n      title: newTitle.trim(),\n      body: newBody.trim(),\n      variant: newVariant.trim() || 'Color: Matte Navy · Size: L',\n      verified: true,\n      helpfulCount: 0,\n      isHelpful: false,\n    }\n\n    setReviews((prev) => [created, ...prev])\n    setNewTitle('')\n    setNewBody('')\n    setNewAuthor('')\n    setNewRating(5)\n    setIsWritingReview(false)\n  }\n\n  const filteredReviews = React.useMemo(() => {\n    let result = [...reviews]\n\n    if (selectedRating !== null) {\n      result = result.filter((r) => r.rating === selectedRating)\n    }\n\n    if (withPhotosOnly) {\n      result = result.filter((r) => r.photos && r.photos.length > 0)\n    }\n\n    if (verifiedOnly) {\n      result = result.filter((r) => r.verified)\n    }\n\n    if (sortBy === 'highest') {\n      result.sort((a, b) => b.rating - a.rating)\n    } else if (sortBy === 'lowest') {\n      result.sort((a, b) => a.rating - b.rating)\n    } else if (sortBy === 'helpful') {\n      result.sort((a, b) => b.helpfulCount - a.helpfulCount)\n    }\n\n    return result\n  }, [reviews, selectedRating, withPhotosOnly, verifiedOnly, sortBy])\n\n  return (\n    <section data-slot=\"customer-reviews\" className=\"w-full space-y-8\">\n      {/* Section Header */}\n      <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n        <div>\n          <h2 className=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl\">Customer Reviews</h2>\n          <p className=\"text-muted-foreground mt-1 text-sm\">Real feedback from verified purchasers</p>\n        </div>\n        <Button\n          aria-label=\"Close review form\"\n          type=\"button\"\n          className=\"h-9 gap-2 text-xs font-medium sm:text-sm\"\n          onClick={() => setIsWritingReview(!isWritingReview)}\n        >\n          <PenLine className=\"size-4\" />\n          Write a Review\n        </Button>\n      </div>\n\n      {/* Ratings Overview Card (3-column layout on md+) */}\n      <Card className=\"border-border bg-card p-6 shadow-xs\">\n        <div className=\"grid grid-cols-1 gap-6 md:grid-cols-12 md:items-center lg:gap-8\">\n          {/* Col 1: Big Rating Display */}\n          <div className=\"border-border flex flex-col items-center justify-center space-y-2 border-b pb-6 text-center md:col-span-4 md:items-start md:border-r md:border-b-0 md:pr-6 md:pb-0 md:text-left lg:col-span-3\">\n            <div className=\"flex items-baseline gap-2\">\n              <span className=\"text-foreground text-4xl font-bold tracking-tight\">4.8</span>\n              <span className=\"text-muted-foreground text-sm font-medium\">out of 5</span>\n            </div>\n            <Rating value={4.8} readonly halfIncrements size=\"medium\" />\n            <p className=\"text-muted-foreground text-xs\">Based on 342 reviews</p>\n            <Badge\n              variant=\"secondary\"\n              className=\"border-success/20 bg-success/10 text-success mt-1 gap-1.5 font-medium\"\n            >\n              <CheckCircle2 className=\"size-3.5\" />\n              96% recommend\n            </Badge>\n          </div>\n\n          {/* Col 2: Rating Distribution Bars */}\n          <div className=\"border-border space-y-2 border-b pb-6 md:col-span-5 md:border-r md:border-b-0 md:pr-6 md:pb-0 lg:col-span-5\">\n            {ratingBreakdowns.map((bar) => (\n              <button\n                key={bar.stars}\n                type=\"button\"\n                className={cn(\n                  'group hover:bg-muted/60 focus-visible:ring-ring flex w-full items-center gap-3 rounded-md px-2 py-1 text-left text-xs transition-colors focus-visible:ring-2 focus-visible:outline-none',\n                  selectedRating === bar.stars && 'bg-muted ring-primary/30 font-semibold ring-1',\n                )}\n                onClick={() => toggleRatingFilter(bar.stars)}\n              >\n                <span className=\"text-foreground flex w-12 items-center gap-1 font-medium\">\n                  {bar.stars} <Star className=\"fill-warning text-warning size-3\" />\n                </span>\n                <Progress value={bar.percentage} className=\"h-2 flex-1\" />\n                <span className=\"text-muted-foreground group-hover:text-foreground w-10 text-right font-mono\">\n                  {bar.percentage}%\n                </span>\n              </button>\n            ))}\n          </div>\n\n          {/* Col 3: Customer Photos / Videos Gallery */}\n          <div className=\"space-y-3 md:col-span-3 lg:col-span-4\">\n            <div className=\"flex items-center justify-between\">\n              <h4 className=\"text-foreground text-sm font-semibold\">Customer Photos (48)</h4>\n              <span className=\"text-muted-foreground text-xs\">Recent</span>\n            </div>\n            <div className=\"grid grid-cols-3 gap-2\">\n              {customerPhotos.map((photo, index) => (\n                <button\n                  key={photo.id}\n                  type=\"button\"\n                  className=\"group border-border bg-muted focus-visible:ring-ring relative aspect-square cursor-pointer overflow-hidden rounded-lg border focus-visible:ring-2 focus-visible:outline-none\"\n                  aria-label={photo.alt}\n                  onClick={() => setActivePhotoUrl(photo.url)}\n                >\n                  <img\n                    src={photo.url}\n                    alt={photo.alt}\n                    className=\"size-full object-cover transition-transform duration-300 group-hover:scale-105\"\n                  />\n                  {index === 5 && (\n                    <div className=\"absolute inset-0 flex items-center justify-center bg-black/60 text-xs font-semibold text-white transition-colors group-hover:bg-black/70\">\n                      +43 more\n                    </div>\n                  )}\n                </button>\n              ))}\n            </div>\n          </div>\n        </div>\n      </Card>\n\n      {/* Write a Review Expandable Panel */}\n      {isWritingReview && (\n        <Card className=\"border-primary/30 bg-card p-6 shadow-sm\">\n          <div className=\"space-y-4\">\n            <div className=\"flex items-center justify-between\">\n              <h3 className=\"text-foreground text-base font-semibold\">Write Your Review</h3>\n              <Button\n                aria-label=\"Close review form\"\n                type=\"button\"\n                variant=\"ghost\"\n                size=\"icon\"\n                className=\"text-muted-foreground hover:text-foreground size-8\"\n                onClick={() => setIsWritingReview(false)}\n              >\n                <X className=\"size-4\" />\n              </Button>\n            </div>\n\n            <div className=\"space-y-3\">\n              <div>\n                <label className=\"text-foreground mb-1.5 block text-xs font-medium\">Overall Rating</label>\n                <Rating value={newRating} onValueChange={setNewRating} size=\"medium\" hover />\n              </div>\n\n              <div className=\"grid gap-3 sm:grid-cols-2\">\n                <div>\n                  <label className=\"text-foreground mb-1.5 block text-xs font-medium\">Your Name</label>\n                  <input\n                    value={newAuthor}\n                    onChange={(e) => setNewAuthor(e.target.value)}\n                    type=\"text\"\n                    placeholder=\"e.g. Alex Morgan\"\n                    className=\"border-border bg-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-xs shadow-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                  />\n                </div>\n                <div>\n                  <label className=\"text-foreground mb-1.5 block text-xs font-medium\">Purchased Option</label>\n                  <input\n                    value={newVariant}\n                    onChange={(e) => setNewVariant(e.target.value)}\n                    type=\"text\"\n                    placeholder=\"e.g. Color: Space Black · Size: L\"\n                    className=\"border-border bg-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-xs shadow-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                  />\n                </div>\n              </div>\n\n              <div>\n                <label className=\"text-foreground mb-1.5 block text-xs font-medium\">Review Headline</label>\n                <input\n                  value={newTitle}\n                  onChange={(e) => setNewTitle(e.target.value)}\n                  type=\"text\"\n                  placeholder=\"Summarize your experience in one sentence\"\n                  className=\"border-border bg-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border px-3 py-1 text-xs shadow-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                />\n              </div>\n\n              <div>\n                <label className=\"text-foreground mb-1.5 block text-xs font-medium\">Detailed Feedback</label>\n                <textarea\n                  value={newBody}\n                  onChange={(e) => setNewBody(e.target.value)}\n                  rows={3}\n                  placeholder=\"What did you like or dislike? How does it perform?\"\n                  className=\"border-border bg-background placeholder:text-muted-foreground focus-visible:ring-ring flex w-full rounded-md border px-3 py-2 text-xs shadow-xs transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n                />\n              </div>\n\n              <div className=\"flex items-center justify-end gap-2 pt-2\">\n                <Button\n                  aria-label=\"Close review form\"\n                  type=\"button\"\n                  variant=\"outline\"\n                  size=\"sm\"\n                  className=\"h-8 text-xs\"\n                  onClick={() => setIsWritingReview(false)}\n                >\n                  Cancel\n                </Button>\n                <Button\n                  type=\"button\"\n                  size=\"sm\"\n                  className=\"h-8 text-xs\"\n                  disabled={!newTitle.trim() || !newBody.trim() || newRating === 0}\n                  onClick={submitReview}\n                >\n                  Submit Review\n                </Button>\n              </div>\n            </div>\n          </div>\n        </Card>\n      )}\n\n      {/* Review Filters & Sort Toolbar */}\n      <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n        {/* Filter chips */}\n        <div className=\"flex flex-wrap items-center gap-2\">\n          <Button\n            type=\"button\"\n            size=\"sm\"\n            variant={selectedRating === null && !withPhotosOnly && !verifiedOnly ? 'default' : 'outline'}\n            className=\"h-8 rounded-full text-xs\"\n            onClick={resetFilters}\n          >\n            All Ratings\n          </Button>\n          <Button\n            type=\"button\"\n            size=\"sm\"\n            variant={selectedRating === 5 ? 'default' : 'outline'}\n            className=\"h-8 gap-1 rounded-full text-xs\"\n            onClick={() => toggleRatingFilter(5)}\n          >\n            <Star className={cn('size-3', selectedRating === 5 ? 'fill-current' : 'fill-warning text-warning')} />5\n            Stars\n          </Button>\n          <Button\n            type=\"button\"\n            size=\"sm\"\n            variant={withPhotosOnly ? 'default' : 'outline'}\n            className=\"h-8 gap-1.5 rounded-full text-xs\"\n            onClick={() => setWithPhotosOnly(!withPhotosOnly)}\n          >\n            <ImageIcon className=\"size-3.5\" />\n            With Photos\n          </Button>\n          <Button\n            type=\"button\"\n            size=\"sm\"\n            variant={verifiedOnly ? 'default' : 'outline'}\n            className=\"h-8 gap-1.5 rounded-full text-xs\"\n            onClick={() => setVerifiedOnly(!verifiedOnly)}\n          >\n            <CheckCircle2 className=\"size-3.5\" />\n            Verified Only\n          </Button>\n        </div>\n\n        {/* Sort Dropdown */}\n        <div className=\"flex items-center gap-2\">\n          <span className=\"text-muted-foreground text-xs font-medium\">Sort by:</span>\n          <Select value={sortBy} onValueChange={(val: any) => setSortBy(val)}>\n            <SelectTrigger className=\"h-8 w-36 text-xs sm:w-40\">\n              <SelectValue placeholder=\"Sort by\" />\n            </SelectTrigger>\n            <SelectContent>\n              <SelectItem value=\"recent\">Most Recent</SelectItem>\n              <SelectItem value=\"highest\">Highest Rated</SelectItem>\n              <SelectItem value=\"lowest\">Lowest Rated</SelectItem>\n              <SelectItem value=\"helpful\">Most Helpful</SelectItem>\n            </SelectContent>\n          </Select>\n        </div>\n      </div>\n\n      {/* Reviews List */}\n      <div className=\"space-y-4\">\n        {filteredReviews.length === 0 ? (\n          <div className=\"border-border bg-card rounded-xl border p-12 text-center\">\n            <p className=\"text-foreground text-sm font-medium\">No reviews match the selected filters</p>\n            <p className=\"text-muted-foreground mt-1 text-xs\">\n              Try clearing your filters to view all customer feedback\n            </p>\n            <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"mt-4 h-8 text-xs\" onClick={resetFilters}>\n              Reset Filters\n            </Button>\n          </div>\n        ) : (\n          filteredReviews.map((rev) => (\n            <Card key={rev.id} className=\"border-border bg-card p-5 shadow-xs\">\n              <div className=\"space-y-4\">\n                {/* Header Row */}\n                <div className=\"flex flex-wrap items-start justify-between gap-3\">\n                  <div className=\"flex items-center gap-3\">\n                    <Avatar className=\"border-border size-10 border\">\n                      {rev.avatar && <AvatarImage src={rev.avatar} alt={rev.author} />}\n                      <AvatarFallback className=\"text-xs font-medium\">{rev.initials}</AvatarFallback>\n                    </Avatar>\n                    <div className=\"space-y-0.5\">\n                      <div className=\"flex items-center gap-2\">\n                        <span className=\"text-foreground text-sm font-semibold\">{rev.author}</span>\n                        {rev.verified && (\n                          <Badge\n                            variant=\"secondary\"\n                            className=\"text-muted-foreground h-5 gap-1 px-1.5 text-xs font-normal\"\n                          >\n                            <CheckCircle2 className=\"text-success size-3\" />\n                            Verified Buyer\n                          </Badge>\n                        )}\n                      </div>\n                      <time className=\"text-muted-foreground text-xs\">{rev.date}</time>\n                    </div>\n                  </div>\n                  <Rating value={rev.rating} readonly size=\"small\" />\n                </div>\n\n                {/* Review Content */}\n                <div className=\"space-y-2\">\n                  <h5 className=\"text-foreground text-sm font-semibold sm:text-base\">{rev.title}</h5>\n                  <p className=\"text-muted-foreground text-xs leading-relaxed sm:text-sm\">{rev.body}</p>\n                </div>\n\n                {/* Product Variant */}\n                {rev.variant && (\n                  <div className=\"bg-muted/60 text-muted-foreground inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium\">\n                    <span>{rev.variant}</span>\n                  </div>\n                )}\n\n                {/* Attached Photos */}\n                {rev.photos && rev.photos.length > 0 && (\n                  <div className=\"flex flex-wrap gap-2 pt-1\">\n                    {rev.photos.map((photoUrl, pIdx) => (\n                      <button\n                        key={pIdx}\n                        type=\"button\"\n                        className=\"group border-border bg-muted focus-visible:ring-ring relative size-16 cursor-pointer overflow-hidden rounded-lg border focus-visible:ring-2 focus-visible:outline-none sm:size-20\"\n                        aria-label={`Review photo ${pIdx + 1} by ${rev.author}`}\n                        onClick={() => setActivePhotoUrl(photoUrl)}\n                      >\n                        <img\n                          src={photoUrl}\n                          alt={`Review photo ${pIdx + 1} by ${rev.author}`}\n                          className=\"size-full object-cover transition-transform duration-300 group-hover:scale-105\"\n                        />\n                      </button>\n                    ))}\n                  </div>\n                )}\n\n                {/* Helpful Action Button */}\n                <div className=\"border-border flex items-center justify-between border-t pt-3\">\n                  <p className=\"text-muted-foreground text-xs\">Was this review helpful?</p>\n                  <Button\n                    type=\"button\"\n                    variant=\"outline\"\n                    size=\"sm\"\n                    className={cn(\n                      'h-8 gap-1.5 text-xs',\n                      rev.isHelpful && 'border-primary/40 bg-primary/10 text-primary font-medium',\n                    )}\n                    onClick={() => toggleHelpful(rev.id)}\n                  >\n                    <ThumbsUp className={cn('size-3.5', rev.isHelpful && 'fill-primary')} />\n                    Helpful ({rev.helpfulCount})\n                  </Button>\n                </div>\n              </div>\n            </Card>\n          ))\n        )}\n      </div>\n\n      {/* Pagination / Load More */}\n      <div className=\"border-border flex flex-col items-center justify-between gap-4 border-t pt-6 sm:flex-row\">\n        <p className=\"text-muted-foreground text-xs\">Showing 1-{filteredReviews.length} of 342 reviews</p>\n        {!hasLoadedMore && (\n          <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-9 px-4 text-xs font-medium\" onClick={loadMore}>\n            Load More Reviews\n          </Button>\n        )}\n      </div>\n\n      {/* Photo Modal / Lightbox */}\n      {activePhotoUrl && (\n        <div\n          className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-xs\"\n          onClick={() => setActivePhotoUrl(null)}\n        >\n          <div\n            className=\"border-border bg-card relative max-h-[85vh] max-w-2xl overflow-hidden rounded-xl border p-3 shadow-sm\"\n            onClick={(e) => e.stopPropagation()}\n          >\n            <img\n              src={activePhotoUrl}\n              alt=\"Customer review photo preview\"\n              className=\"max-h-[75vh] w-auto rounded-lg object-contain\"\n            />\n            <div className=\"flex items-center justify-between p-2 pt-3\">\n              <span className=\"text-muted-foreground text-xs\">Customer Review Photo</span>\n              <Button\n                type=\"button\"\n                variant=\"ghost\"\n                size=\"sm\"\n                className=\"h-7 text-xs\"\n                onClick={() => setActivePhotoUrl(null)}\n              >\n                Close\n              </Button>\n            </div>\n          </div>\n        </div>\n      )}\n    </section>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/CustomerReviews.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/avatar.json",
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/progress.json",
    "https://uipkge.dev/r/react/rating.json",
    "https://uipkge.dev/r/react/select.json"
  ],
  "description": "Dedicated customer reviews section with ratings breakdown, interactive distribution bars, photo gallery with thumbnail overlay, filter chips, sort options, detailed verified buyer cards with attached photos, reactive helpful counter, and review submission form.",
  "categories": [
    "commerce",
    "ecommerce",
    "marketing"
  ]
}