Showing AI reviews for avriti
Project AI Score ?
63%
Quality Avg ?
68%
Security Avg ?
45%
Reviews ?
56

Review Result ?

jattin01/avriti · 3c6284c8
The commit adds styling for lists and implements About and Home page components that fetch and display data from an API. The code follows React hooks for data fetching and uses TypeScript for typings. However, it uses dangerouslySetInnerHTML without sanitization, increasing XSS risk. The commit message is poor and uninformative, which reduces clarity and maintainability. The components lack error handling and loading states, presenting UX and robustness issues.
Quality ?
70%
Security ?
40%
Business Value ?
60%
Maintainability ?
70%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Issue
Where commit message
Issue / Evidence issue
Suggested Fix provide meaningful descriptive commit messages explaining purpose and scope of changes
Issue
Where app/about/page.tsx:30
Issue / Evidence issue
Suggested Fix handle errors and loading state in data fetching hook to improve UX and robustness
Security Issue
Where app/about/page.tsx:70
Issue / Evidence security
Suggested Fix sanitize content before using dangerouslySetInnerHTML to prevent XSS attacks
Security Issue
Where app/about/page.tsx:91
Issue / Evidence security
Suggested Fix sanitize content before using dangerouslySetInnerHTML to prevent XSS attacks
Security Issue
Where app/about/page.tsx:125
Issue / Evidence security
Suggested Fix sanitize content before using dangerouslySetInnerHTML to prevent XSS attacks
Issue
Where app/page.tsx:61
Issue / Evidence issue
Suggested Fix handle errors and loading state in data fetching hook to improve UX and robustness
Issue
Where app/page.tsx:72
Issue / Evidence issue
Suggested Fix handle errors and loading state in data fetching hook to improve UX and robustness
Security Issue
Where app/page.tsx:115
Issue / Evidence security
Suggested Fix sanitize content before using dangerouslySetInnerHTML to prevent XSS attacks
Code Change Preview · app/about/about.css ?
Removed / Before Commit
- \ No newline at end of file
Added / After Commit
+ .data ul {
+     list-style-type: disc;
+     color: #332e2e;
+     margin-left: 25px;
+    
+ }
+ .data ul ::marker {
+     color: var(--color-primary-700);
+     font-size: 23px;
+ }
+ 
+ .data ol {
+     list-style-type: decimal;
+     color: #332e2e;
+     margin-left: 19px;
+    
+ }
+ .data ol ::marker {
Removed / Before Commit
- import Image from "next/image";
- import { Badge } from "@/components/ui/badge";
- import { Card } from "@/components/ui/card";
- 
- export default function AboutPage() {
- return (
- <div>
- <section className="brand-gradient">
- </div>
- </div>
- </section>
-     
- 
-       <section className="mx-auto  max-w-7xl px-4 sm:px-6 lg:px-8 my-[50px] md:my-[80px]">
-           <div className="grid md:grid-cols-2 gap-8">
-                 <div>
-                       <img   src="/banner.png"  alt="Avriti"                                    className="object-contain md:w-[60%] mx-auto" />
-                 </div>
Added / After Commit
+ "use client";
+ import './about.css';
+ import { useEffect, useState } from "react";
+ 
+ type Section = {
+   sub_heading?: string;
+   heading?: string;
+   message?: string;
+   description?: string;
+   image?: string;
+ };
+ 
+ type AboutData = {
+   section1: Section | null;
+   section2: Section | null;
+   section3: Section | null;
+ };
+ 
Removed / Before Commit
- import Image from "next/image";
- import Link from "next/link";
- import { PdfBrowserFrame } from "@/components/pdf-browser-frame";
- import { Button } from "@/components/ui/button";
- import { ProductCard } from "@/components/product-card";
- import { ServiceSlider } from "@/components/service-slider";
- import { FAQ } from "@/components/faq";
- import { TestimonialSlider } from "@/components/testimonial-slider";
- 
- const products = [
-   {
-     slug: "shuddhi-mopping-salt",
-     name: "Avriti Shuddhi - Mopping Salt - 1kg",
-     price: "299",
-     image: "/product2.jpeg",
-     tone: "from-[#E8EDFB] to-[#D0D9F7]",
-      category: "Salt",
-   badge: "New",
Added / After Commit
+ "use client";
+ 
+ import { useEffect, useState } from "react";
+ import Image from "next/image";
+ import { ProductCard } from "@/components/product-card";
+ import Link from "next/link";
+ import { PdfBrowserFrame } from "@/components/pdf-browser-frame";
+ import { Button } from "@/components/ui/button";
+ import { ServiceSlider } from "@/components/service-slider";
+ import { FAQ } from "@/components/faq";
+ import { TestimonialSlider } from "@/components/testimonial-slider";
+ 
+ type FeaturedProduct = {
+   slug: string;
+   name: string;
+   attrName: string;
+   price: string;
+   image: string;
Removed / Before Commit
- }
- 
- export default function ShopPage() {
-   const [selected, setSelected] = useState<number[]>([]);
- const [categories, setCategories] = useState<Category[]>([]);
- const [products, setProducts] = useState<Product[]>([]);
- 
- useEffect(() => {
- const fetchCategories = async () => {
-       const res = await fetch('https://api.digitalmission.in/api/categories');
- const data = await res.json();
- setCategories(data.data);
- };
- 
- useEffect(() => {
- const fetchProducts = async () => {
-       const res = await fetch('https://api.digitalmission.in/api/product');
- const data = await res.json();
Added / After Commit
+ }
+ 
+ export default function ShopPage() {
+   const [selected, setSelected] = useState<number | null>(null);
+ const [categories, setCategories] = useState<Category[]>([]);
+ const [products, setProducts] = useState<Product[]>([]);
+   const [loading, setLoading] = useState(false);
+ 
+ useEffect(() => {
+ const fetchCategories = async () => {
+       const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/categories`);
+ const data = await res.json();
+ setCategories(data.data);
+ };
+ 
+ useEffect(() => {
+ const fetchProducts = async () => {
+       setLoading(true);
Removed / Before Commit
- "use client";
- 
- import { useState } from "react";
- import { Plus, Minus } from "lucide-react";
- 
- const faqs = [
-   {
-     id: 1,
-     question: "What is Avriti and what does it mean?",
-     answer:
-       "Avriti means 'return' — a homecoming to the self. It is a spiritual wellness brand rooted in Vedic wisdom, offering services in Numerology, Vedic Astrology, Tarot, and Vastu Shastra, alongside sacred products designed to bring clarity and alignment to your life.",
-   },
-   {
-     id: 2,
-     question: "How do I book a consultation?",
-     answer:
-       "Simply click on 'Book Consultation,' choose your preferred type (Audio, Video, or Physical), select a date and time, and complete the booking with payment. You will receive a confirmation via email with all session details.",
-   },
Added / After Commit
+ "use client";
+ 
+ import { useState, useEffect } from "react";
+ import { Plus, Minus } from "lucide-react";
+ 
+ type FaqItem = {
+   id: number;
+   question: string;
+   answer: string;
+ };
+ 
+ export function FAQ() {
+ const [openId, setOpenId] = useState<number | null>(null);
+   const [faqs, setFaqs] = useState<FaqItem[]>([]);
+ 
+   useEffect(() => {
+     fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/faqs`)
+       .then((res) => res.json())
Removed / Before Commit
- import Image from "next/image";
- import Link from "next/link";
- import { ArrowRight, ShoppingBag } from "lucide-react";
- import { Badge } from "@/components/ui/badge";
- import { Button } from "@/components/ui/button";
- import { Card } from "@/components/ui/card";
- import { products } from "@/lib/data";
- 
- export function ProductCard({ product }: { product: (typeof products)[number] }) {
- return (
- <Card className="overflow-hidden">
- <Link href={`/shop/${product.slug}`} className="block h-full flex flex-col justify-between">
-         <h3 className="mt-2 text-lg mb-[20px] text-[var(--textcolor)] font-normal">{product.name}</h3>
- <div className={`relative ${product.tone}`}>
- 
- <img
Added / After Commit
+ import Link from "next/link";
+ import { Button } from "@/components/ui/button";
+ import { Card } from "@/components/ui/card";
+ 
+ type ProductCardProps = {
+   slug: string;
+   name: string;
+   attrName?: string;
+   price: string;
+   image: string;
+   tone: string;
+   category?: string;
+   badge?: string;
+   description?: string;
+ };
+ 
+ export function ProductCard({ product }: { product: ProductCardProps }) {
+ return (
Removed / Before Commit
- port: '8000',
- pathname: '/**',
- },
- ],
-     unoptimized: true,  // ✅ yeh add karo
- },
- };
Added / After Commit
+ port: '8000',
+ pathname: '/**',
+ },
+       {
+         protocol: 'https',
+         hostname: 'api.digitalmission.in',
+         pathname: '/**',
+       },
+ ],
+     unoptimized: true,
+ },
+ };