mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-16 04:26:13 +01:00
Added search bar for expense list page (#52)
* Added search bar for expense list page * Change search input styling --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
33
src/components/ui/search-bar.tsx
Normal file
33
src/components/ui/search-bar.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as React from "react"
|
||||
|
||||
import {Input} from "@/components/ui/input";
|
||||
import {cn} from "@/lib/utils";
|
||||
import {
|
||||
Search
|
||||
} from 'lucide-react'
|
||||
|
||||
export interface InputProps
|
||||
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||
|
||||
const SearchBar = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
({ className, type, ...props }, ref) => {
|
||||
return (
|
||||
<div className="mx-4 sm:mx-6 flex relative">
|
||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
||||
<Input
|
||||
type={type}
|
||||
className={cn(
|
||||
"pl-10 text-sm focus:text-base bg-muted border-none text-muted-foreground",
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
placeholder="Search for an expense…"
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
||||
SearchBar.displayName = "SearchBar"
|
||||
|
||||
export { SearchBar }
|
||||
Reference in New Issue
Block a user