Skip to content

Conversation

@BorDevTech
Copy link
Contributor

No description provided.

@BorDevTech BorDevTech self-assigned this Dec 29, 2025
Copilot AI review requested due to automatic review settings December 29, 2025 22:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements search functionality with mock JSON data on the client side, along with various code cleanup improvements across multiple files.

  • Adds a Combobox-based search feature that filters mock data from a JSON file
  • Updates icon exports to include MinusIcon and PlusIcon
  • Refactors code quality improvements (const vs let, removing unused imports)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/components/ui/icons/index.ts Adds MinusIcon and PlusIcon exports from react-icons/fa
src/app/stop-the-stigma/page.tsx Refactors variable declarations from let to const and removes unused MdMoon import
src/app/search/page.tsx Implements main search functionality with Combobox component and mock data integration
src/app/search/mock.json Adds new mock data file with searchable items containing title, link, and dataValue fields
src/app/page.tsx Removes unused useBreakpointValue import
src/app/contact/page.tsx Removes unused BodyTemplate and SectionTemplate imports
src/app/about-us/page.tsx Adds asChild prop to ChakraImage components for proper composition with NextImage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 4 to +19
import {
Container, Box, Text, CloseButton, Input, InputGroup, Button, AbsoluteCenter, VStack, HStack, Heading,
Link as ChakraLink, Center, SimpleGrid, GridItem, Stack, Card, Image as ChakraImage
Container, Box, Text, CloseButton, Input, InputGroup, AbsoluteCenter, VStack, HStack, Heading,
SimpleGrid
} from '@chakra-ui/react';
import { useRef, useState } from "react"
import { poppins } from '../../components/ui/fonts';
import checkDeviceSize from '../../components/ui/breakpoints';
import { poppins } from '@/components/ui/fonts';
import checkDeviceSize from '@/components/ui/breakpoints';
import mockData from '@/app/search/mock.json'


import {
Combobox,
Portal,
useFilter,
useListCollection,
} from "@chakra-ui/react"
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chakra UI imports are split across two separate import statements (lines 4-7 and lines 14-19), both importing from "@chakra-ui/react". These should be consolidated into a single import statement for better code organization and readability.

Copilot uses AI. Check for mistakes.

<InputGroup endElement={endElement} _light={{ color: "white" }}>
<Input
list={searchlist.toString()}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'list' prop is being set to 'searchlist.toString()' which will convert the array to a string representation like "[object Object],[object Object],...". This is not a valid use of the HTML 'list' attribute. If you're trying to create a datalist, you need to provide the ID of a datalist element. Otherwise, this prop should be removed as the Combobox component above already handles the search suggestions.

Copilot uses AI. Check for mistakes.
<Input
list={searchlist.toString()}
ref={inputRef}
placeholder="Email"
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder text is "Email" but this appears to be a general search input, not an email field. The placeholder should be updated to reflect the actual purpose of this input field (e.g., "Search..." or similar).

Copilot uses AI. Check for mistakes.
<InputGroup endElement={endElement}>
<InputGroup endElement={endElement} >
<Input
list={searchlist.toString()}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'list' prop is being set to 'searchlist.toString()' which will convert the array to a string representation like "[object Object],[object Object],...". This is not a valid use of the HTML 'list' attribute. If you're trying to create a datalist, you need to provide the ID of a datalist element. Otherwise, this prop should be removed.

Copilot uses AI. Check for mistakes.
<Input
list={searchlist.toString()}
ref={inputRef}
placeholder="Email"
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder text is "Email" but this appears to be a general search input, not an email field. The placeholder should be updated to reflect the actual purpose of this input field (e.g., "Search..." or similar).

Copilot uses AI. Check for mistakes.

export default function Search() {
//Retrieve mock data from json file
const [searchlist, setSearchlist] = useState(mockData)
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state variable 'searchlist' is initialized but the setter 'setSearchlist' is never used in the component. Since the mock data is static, this should be a regular constant rather than state. If you need it to be state for future updates, consider removing the unused setter or using it appropriately.

Suggested change
const [searchlist, setSearchlist] = useState(mockData)
const searchlist = mockData

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +103
{collection.items.map((item) => (
<Combobox.Item key={item.title} item={item}>
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'item.title' as the key for list items can cause issues if there are duplicate titles in the mock data. The key should be unique for each item. Consider adding a unique 'id' field to each item in the mock data and using that as the key instead.

Suggested change
{collection.items.map((item) => (
<Combobox.Item key={item.title} item={item}>
{collection.items.map((item, index) => (
<Combobox.Item key={`${item.title}-${index}`} item={item}>

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +122

<InputGroup endElement={endElement} _light={{ color: "white" }}>
<Input
list={searchlist.toString()}
ref={inputRef}
placeholder="Email"
value={value}
onChange={(e) => {
setValue(e.currentTarget.value)
}}
/>
</InputGroup>
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two separate search input implementations in this component (Combobox on lines 85-110 and InputGroup on lines 112-122). They appear to serve the same purpose but are not synchronized, which can confuse users. Consider removing the redundant InputGroup or clarifying the distinct purposes of these two inputs.

Suggested change
<InputGroup endElement={endElement} _light={{ color: "white" }}>
<Input
list={searchlist.toString()}
ref={inputRef}
placeholder="Email"
value={value}
onChange={(e) => {
setValue(e.currentTarget.value)
}}
/>
</InputGroup>

Copilot uses AI. Check for mistakes.


export default function Search() {
//Retrieve mock data from json file
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment delimiter lacks proper spacing. It should be formatted as '// Retrieve mock data from json file' with a space after the double slashes for better readability.

Suggested change
//Retrieve mock data from json file
// Retrieve mock data from json file

Copilot uses AI. Check for mistakes.

import { FaRegObjectGroup as FaObjectGroup, FaRegListAlt as FaListAlt, FaRegNewspaper as FaNewspaper, FaRegKeyboard as FaKeyboard } from "react-icons/fa";
import { MdBrightness4 as MdMoon, MdBrightness5 as MdSun } from 'react-icons/md';
import { MdBrightness5 as MdSun } from 'react-icons/md';
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import MdSun.

Suggested change
import { MdBrightness5 as MdSun } from 'react-icons/md';

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@BorDevTech BorDevTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work no bugs! 👍

@BorDevTech BorDevTech merged commit c4e670c into master Dec 29, 2025
6 checks passed
@BorDevTech BorDevTech linked an issue Dec 29, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetch temporary JSON data

1 participant