AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
63%
Quality Avg
?
68%
Security Avg
?
45%
Reviews
?
56
Review Result ?
jattin01/avriti · f4a78b40
The commit adds styling for a '.data' class and fetches and displays about and home data from an API with conditional rendering. The usage of dangerouslySetInnerHTML to display HTML content from fetched data introduces potential security risks like XSS. Error handling in fetch calls is minimal, ignoring errors silently. The commit message is uninformative. Overall, the code implements the intended feature but lacks secure handling of HTML content and comprehensive error handling.
Quality
?
70%
Security
?
50%
Business Value
?
75%
Maintainability
?
65%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Uninformative
Where
commit message
Issue / Evidence
uninformative
Suggested Fix
provide a descriptive commit message summarizing changes and purpose
Usage Of Dangerouslysetinnerhtml Without S...
Where
app/about/page.tsx:70
Issue / Evidence
usage of dangerouslySetInnerHTML without sanitization
Suggested Fix
sanitize input HTML to prevent XSS attacks
Usage Of Dangerouslysetinnerhtml Without S...
Where
app/about/page.tsx:91
Issue / Evidence
usage of dangerouslySetInnerHTML without sanitization
Suggested Fix
sanitize input HTML to prevent XSS attacks
Usage Of Dangerouslysetinnerhtml Without S...
Where
app/about/page.tsx:125
Issue / Evidence
usage of dangerouslySetInnerHTML without sanitization
Suggested Fix
sanitize input HTML to prevent XSS attacks
Catch Block Is Empty
Where
app/about/page.tsx:30
Issue / Evidence
catch block is empty
Suggested Fix
add logging or user feedback on fetch error to improve error visibility
Catch Block Is Empty
Where
app/page.tsx:61
Issue / Evidence
catch block is empty
Suggested Fix
add logging or user feedback on fetch error to improve error visibility
Catch Block Is Empty
Where
app/page.tsx:73
Issue / Evidence
catch block is empty
Suggested Fix
add logging or user feedback on fetch error to improve error visibility
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('http://localhost:8000/api/categories'); - const data = await res.json(); - setCategories(data.data); - }; - - useEffect(() => { - const fetchProducts = async () => { - const res = await fetch('http://localhost:8000/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, + }, + };