Skip to content

feat: implement services directory page with filtering and search fun…#14

Merged
ByMuhmd merged 2 commits into
mainfrom
Sami
Jul 4, 2026
Merged

feat: implement services directory page with filtering and search fun…#14
ByMuhmd merged 2 commits into
mainfrom
Sami

Conversation

@ByMuhmd

@ByMuhmd ByMuhmd commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 4, 2026 14:34
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hirfa Ready Ready Preview, Comment Jul 4, 2026 2:34pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

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 adds a new client-facing “Services directory” page at /client/services that lists service categories with topic-based filtering and text search, and updates the client home page “View all” link to route to this new directory.

Changes:

  • Added app/client/services/page.tsx implementing the services directory UI (topics, search, category grid) and fetching categories from Supabase.
  • Updated app/client/home/page.tsx to link “عرض الكل” to /client/services instead of /client/services/all.

Reviewed changes

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

File Description
app/client/services/page.tsx New services directory page with topic filters, search, and Supabase-backed category loading.
app/client/home/page.tsx Routes “عرض الكل” to the new services directory page.

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

Comment on lines +39 to +59
const supabase = createClient()
const [categories, setCategories] = useState(HARDCODED_CATEGORIES)
const [loading, setLoading] = useState(true)
const [searchQuery, setSearchQuery] = useState('')
const [activeTopic, setActiveTopic] = useState<string | 'all'>('all')

useEffect(() => {
const fetchCategories = async () => {
setLoading(true)
const { data } = await supabase.from('categories').select('*').order('usage_count', { ascending: false })
if (data && data.length > 0) {
const merged = data.map(dbCat => {
const hc = HARDCODED_CATEGORIES.find(c => c.id === dbCat.id)
return { ...dbCat, topicId: hc?.topicId || 'general' }
})
setCategories(merged)
}
setLoading(false)
}
fetchCategories()
}, [supabase])
Comment on lines +61 to +65
const filteredCategories = categories.filter(c => {
const matchesSearch = c.label_ar.includes(searchQuery)
const matchesTopic = activeTopic === 'all' || c.topicId === activeTopic
return matchesSearch && matchesTopic
})
@ByMuhmd ByMuhmd merged commit dabd075 into main Jul 4, 2026
9 checks passed
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.

2 participants