{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"ecommerce-ecommerce-customer-reviews-review-stats-overview","type":"registry:block","title":"Review Stats Overview","files":[{"path":"components/blocks/ecommerce/ecommerce-customer-reviews/review-stats-overview.tsx","content":"import { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { Progress } from \"@/components/ui/progress\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Star, TrendingUp, Users, ThumbsUp, Award } from \"lucide-react\";\n\nexport default function ReviewStatsOverview() {\n  const stats = {\n    averageRating: 4.8,\n    totalReviews: 2547,\n    recommendationRate: 97,\n    ratingDistribution: [\n      { stars: 5, count: 1893, percentage: 74 },\n      { stars: 4, count: 509, percentage: 20 },\n      { stars: 3, count: 102, percentage: 4 },\n      { stars: 2, count: 25, percentage: 1 },\n      { stars: 1, count: 18, percentage: 1 },\n    ],\n  };\n\n  const highlights = [\n    {\n      icon: ThumbsUp,\n      title: \"Customer Satisfaction\",\n      value: \"97%\",\n      description: \"Would recommend to friends\",\n      trend: \"+2.3%\",\n    },\n    {\n      icon: Users,\n      title: \"Total Reviews\",\n      value: \"2,547\",\n      description: \"Verified customer reviews\",\n      trend: \"+324 this month\",\n    },\n    {\n      icon: Award,\n      title: \"Quality Rating\",\n      value: \"4.8/5\",\n      description: \"Average product rating\",\n      trend: \"+0.2 this quarter\",\n    },\n    {\n      icon: TrendingUp,\n      title: \"Growth Rate\",\n      value: \"15%\",\n      description: \"Monthly review increase\",\n      trend: \"Consistent growth\",\n    },\n  ];\n\n  const recentReviews = [\n    {\n      name: \"Maria Garcia\",\n      rating: 5,\n      review:\n        \"Outstanding quality and fast delivery. Exceeded my expectations!\",\n      product: \"Wireless Earbuds Pro\",\n      time: \"2 hours ago\",\n    },\n    {\n      name: \"Kevin Johnson\",\n      rating: 5,\n      review:\n        \"Perfect product, works exactly as described. Great value for money.\",\n      product: \"Smart Home Hub\",\n      time: \"5 hours ago\",\n    },\n    {\n      name: \"Lisa Chen\",\n      rating: 4,\n      review:\n        \"Really good product overall. Minor shipping delay but worth the wait.\",\n      product: \"Bluetooth Speaker\",\n      time: \"1 day ago\",\n    },\n  ];\n\n  return (\n    <div className=\"container mx-auto px-4 py-24 md:px-6 lg:py-32 2xl:max-w-[1400px]\">\n      <div className=\"mb-16 text-center\">\n        <h2 className=\"mb-4 text-3xl font-bold tracking-tight sm:text-4xl\">\n          Customer Review Analytics\n        </h2>\n        <p className=\"text-muted-foreground mx-auto max-w-2xl text-lg\">\n          Comprehensive insights from our customer feedback and reviews\n        </p>\n      </div>\n\n      {/* Stats Overview */}\n      <div className=\"mb-12 grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4\">\n        {highlights.map((highlight, index) => (\n          <Card key={index} className=\"gap-3\">\n            <CardHeader className=\"flex flex-row items-center justify-between space-y-0\">\n              <CardTitle className=\"text-sm font-medium\">\n                {highlight.title}\n              </CardTitle>\n              <highlight.icon className=\"text-muted-foreground size-4\" />\n            </CardHeader>\n            <CardContent>\n              <div className=\"text-2xl font-bold\">{highlight.value}</div>\n              <p className=\"text-muted-foreground mb-2 text-xs\">\n                {highlight.description}\n              </p>\n              <Badge variant=\"secondary\" className=\"text-xs\">\n                {highlight.trend}\n              </Badge>\n            </CardContent>\n          </Card>\n        ))}\n      </div>\n\n      <div className=\"grid grid-cols-1 gap-8 lg:grid-cols-2\">\n        {/* Rating Distribution */}\n        <Card className=\"gap-3\">\n          <CardHeader>\n            <CardTitle className=\"flex items-center gap-2\">\n              <Star className=\"size-5 fill-yellow-400 text-yellow-400\" />\n              Rating Distribution\n            </CardTitle>\n          </CardHeader>\n          <CardContent>\n            <div className=\"space-y-4\">\n              <div className=\"mb-6 flex items-center justify-between\">\n                <div className=\"\">\n                  <div className=\"text-3xl font-bold\">\n                    {stats.averageRating}\n                  </div>\n                  <div className=\"mt-1 flex items-center justify-center gap-1\">\n                    {[...Array(5)].map((_, i) => (\n                      <Star\n                        key={i}\n                        className={`size-4 ${\n                          i < Math.floor(stats.averageRating)\n                            ? \"fill-yellow-400 text-yellow-400\"\n                            : \"text-muted-foreground\"\n                        }`}\n                      />\n                    ))}\n                  </div>\n                  <div className=\"text-muted-foreground mt-1 text-sm\">\n                    {stats.totalReviews.toLocaleString()} reviews\n                  </div>\n                </div>\n              </div>\n\n              {stats.ratingDistribution.map((rating) => (\n                <div key={rating.stars} className=\"flex items-center gap-4\">\n                  <div className=\"flex w-16 items-center gap-1\">\n                    <span className=\"text-sm\">{rating.stars}</span>\n                    <Star className=\"size-3 fill-yellow-400 text-yellow-400\" />\n                  </div>\n                  <Progress value={rating.percentage} className=\"h-2 flex-1\" />\n                  <div className=\"text-muted-foreground w-12 text-right text-sm\">\n                    {rating.count}\n                  </div>\n                </div>\n              ))}\n            </div>\n          </CardContent>\n        </Card>\n\n        {/* Recent Reviews */}\n        <Card className=\"gap-3\">\n          <CardHeader>\n            <CardTitle>Recent Reviews</CardTitle>\n          </CardHeader>\n          <CardContent>\n            <div className=\"space-y-6\">\n              {recentReviews.map((review, index) => (\n                <div\n                  key={index}\n                  className=\"border-border border-b pb-4 last:border-0 last:pb-0\"\n                >\n                  <div className=\"mb-2 flex items-start justify-between\">\n                    <div>\n                      <h4 className=\"text-sm font-semibold\">{review.name}</h4>\n                      <div className=\"mt-1 flex items-center gap-1\">\n                        {[...Array(5)].map((_, i) => (\n                          <Star\n                            key={i}\n                            className={`size-3 ${\n                              i < review.rating\n                                ? \"fill-yellow-400 text-yellow-400\"\n                                : \"text-muted-foreground\"\n                            }`}\n                          />\n                        ))}\n                      </div>\n                    </div>\n                    <span className=\"text-muted-foreground text-xs\">\n                      {review.time}\n                    </span>\n                  </div>\n                  <p className=\"text-muted-foreground mb-2 text-sm\">\n                    {review.review}\n                  </p>\n                  <p className=\"text-xs font-medium\">{review.product}</p>\n                </div>\n              ))}\n            </div>\n          </CardContent>\n        </Card>\n      </div>\n\n      {/* Bottom Stats */}\n      <div className=\"mt-12 text-center\">\n        <Card className=\"inline-block\">\n          <CardContent>\n            <div className=\"flex items-center gap-8\">\n              <div className=\"text-center\">\n                <div className=\"text-2xl font-bold text-green-600\">\n                  {stats.recommendationRate}%\n                </div>\n                <div className=\"text-muted-foreground text-sm\">\n                  Customers recommend us\n                </div>\n              </div>\n              <div className=\"bg-border h-12 w-px\" />\n              <div className=\"text-center\">\n                <div className=\"text-2xl font-bold\">4.8/5</div>\n                <div className=\"text-muted-foreground text-sm\">\n                  Overall satisfaction\n                </div>\n              </div>\n              <div className=\"bg-border h-12 w-px\" />\n              <div className=\"text-center\">\n                <div className=\"text-2xl font-bold\">99.2%</div>\n                <div className=\"text-muted-foreground text-sm\">\n                  Verified purchases\n                </div>\n              </div>\n            </div>\n          </CardContent>\n        </Card>\n      </div>\n    </div>\n  );\n}\n","type":"registry:component","target":"components/blocks/ecommerce/ecommerce-customer-reviews/review-stats-overview.tsx"},{"path":"components/ui/card.tsx","content":"import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({\n  className,\n  size = \"default\",\n  ...props\n}: React.ComponentProps<\"div\"> & { size?: \"default\" | \"sm\" }) {\n  return (\n    <div\n      data-slot=\"card\"\n      data-size={size}\n      className={cn(\n        \"group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-header\"\n      className={cn(\n        \"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-title\"\n      className={cn(\n        \"font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-description\"\n      className={cn(\"text-sm text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-action\"\n      className={cn(\n        \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-content\"\n      className={cn(\"px-6 group-data-[size=sm]/card:px-4\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-footer\"\n      className={cn(\n        \"flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Card,\n  CardHeader,\n  CardFooter,\n  CardTitle,\n  CardAction,\n  CardDescription,\n  CardContent,\n}\n","type":"registry:ui","target":"components/ui/card.tsx"},{"path":"components/ui/progress.tsx","content":"\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as ProgressPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Progress({\n  className,\n  value,\n  ...props\n}: React.ComponentProps<typeof ProgressPrimitive.Root>) {\n  return (\n    <ProgressPrimitive.Root\n      data-slot=\"progress\"\n      className={cn(\n        \"relative flex h-1.5 w-full items-center overflow-x-hidden rounded-full bg-muted\",\n        className\n      )}\n      {...props}\n    >\n      <ProgressPrimitive.Indicator\n        data-slot=\"progress-indicator\"\n        className=\"size-full flex-1 bg-primary transition-all\"\n        style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n      />\n    </ProgressPrimitive.Root>\n  )\n}\n\nexport { Progress }\n","type":"registry:ui","target":"components/ui/progress.tsx"},{"path":"components/ui/badge.tsx","content":"import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n  \"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n        secondary:\n          \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n        destructive:\n          \"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20\",\n        outline:\n          \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n        ghost:\n          \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n        link: \"text-primary underline-offset-4 hover:underline\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nfunction Badge({\n  className,\n  variant = \"default\",\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"span\"> &\n  VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n  const Comp = asChild ? Slot.Root : \"span\"\n\n  return (\n    <Comp\n      data-slot=\"badge\"\n      data-variant={variant}\n      className={cn(badgeVariants({ variant }), className)}\n      {...props}\n    />\n  )\n}\n\nexport { Badge, badgeVariants }\n","type":"registry:ui","target":"components/ui/badge.tsx"}],"description":"A summary panel with average rating, total count, and a bar chart by star level. Gives shoppers a quick read on overall product quality up front.","dependencies":["class-variance-authority","lucide-react","radix-ui"]}