mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
added new file
This commit is contained in:
parent
9923e5ee13
commit
b1ce906f2f
1 changed files with 34 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
"use client"
|
||||
|
||||
interface ExpandableCountBarProps<T> {
|
||||
title: string
|
||||
items: T[]
|
||||
onClick?: (items: T[]) => void
|
||||
className?: string
|
||||
}
|
||||
|
||||
export default function ExpandableCountBar<T>({
|
||||
title,
|
||||
items,
|
||||
onClick,
|
||||
className = "",
|
||||
}: ExpandableCountBarProps<T>) {
|
||||
|
||||
const count = items.length
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={() => onClick?.(items)}
|
||||
className={`w-full cursor-pointer rounded-xl border bg-white shadow-sm hover:shadow-md transition-all duration-200 p-5 flex justify-between items-center ${className}`}
|
||||
>
|
||||
<div className="text-base font-semibold text-gray-800">
|
||||
{title}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 text-sm text-gray-500">
|
||||
<span>{count} items</span>
|
||||
<span className="text-xs">▼</span>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue