Skip to content

Commit

Permalink
feat(projects): add repository count with tooltip
Browse files Browse the repository at this point in the history
- Display total repo count next to search input
- Show filtered/total count in tooltip when searching
- Maintain consistent styling with dark mode support
  • Loading branch information
kWAYTV committed Dec 6, 2024
1 parent b1fb47a commit 2e185cf
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/components/core/projects/client-projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { useEffect } from 'react';

import { RepositoryCard } from '@/components/core/projects/repository-card';
import { SearchInput } from '@/components/core/projects/search-input';
import { Button } from '@/components/ui/button';
import { Separator } from '@/components/ui/separator';
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip';
import type { Repository } from '@/interfaces/github';
import { useGitHubStore } from '@/store/github';

import { RepositoryCard } from './repository-card';
import { SearchInput } from './search-input';

interface ClientProjectsProps {
initialRepos: Repository[];
}
Expand All @@ -30,7 +34,21 @@ export function ClientProjects({ initialRepos }: ClientProjectsProps) {

return (
<div>
<SearchInput />
<div className='flex items-center gap-4'>
<div className='flex-1'>
<SearchInput />
</div>
<Tooltip>
<TooltipTrigger className='text-sm text-neutral-600 dark:text-neutral-400'>
{filteredRepos.length} repos
</TooltipTrigger>
<TooltipContent>
{filteredRepos.length === initialRepos.length
? `Total repositories: ${initialRepos.length}`
: `Showing ${filteredRepos.length} of ${initialRepos.length} repositories`}
</TooltipContent>
</Tooltip>
</div>
<div className='my-8'>
{currentRepos.map(repo => (
<div key={repo.id}>
Expand Down

0 comments on commit 2e185cf

Please sign in to comment.