-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
368 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/components/common/global-components/filter-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as dropdown from "~/components/ui/dropdown"; | ||
import { MenuIcon } from "lucide-react"; | ||
import * as React from "react"; | ||
|
||
interface FilterComponentProps { | ||
selectedFilter: string; | ||
setSelectedFilter: React.Dispatch<React.SetStateAction<string>>; | ||
items: string[]; | ||
} | ||
export const FilterComponent = ({ | ||
selectedFilter, | ||
setSelectedFilter, | ||
items, | ||
}: FilterComponentProps) => { | ||
return ( | ||
<dropdown.DropdownMenu> | ||
<dropdown.DropdownMenuTrigger asChild> | ||
<button className="flex outline-none items-center gap-1 justify-center w-max px-2 py-1 rounded-md border "> | ||
<MenuIcon size={18} /> | ||
{selectedFilter} | ||
</button> | ||
</dropdown.DropdownMenuTrigger> | ||
<dropdown.DropdownMenuContent> | ||
{items.map((item) => ( | ||
<dropdown.DropdownMenuItem | ||
onClick={() => { | ||
setSelectedFilter(item); | ||
}} | ||
> | ||
{item} | ||
</dropdown.DropdownMenuItem> | ||
))} | ||
</dropdown.DropdownMenuContent> | ||
</dropdown.DropdownMenu> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./search-component"; | ||
export * from "./filter-component"; |
24 changes: 24 additions & 0 deletions
24
src/components/common/global-components/search-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Input } from "~/components/ui/input"; | ||
|
||
interface SearchComponentProps { | ||
value?: string; | ||
setValue: React.Dispatch<React.SetStateAction<string | undefined>>; | ||
placeHolder?: string; | ||
className?: string; | ||
} | ||
|
||
export const SearchComponent = ({ | ||
value, | ||
setValue, | ||
placeHolder, | ||
className, | ||
}: SearchComponentProps) => { | ||
return ( | ||
<Input | ||
placeholder={placeHolder} | ||
value={value} | ||
onChange={(e) => setValue(e.target.value)} | ||
className={`sm:max-w-sm max-w-56 ${className}`} | ||
/> | ||
); | ||
}; |
50 changes: 0 additions & 50 deletions
50
src/components/common/risk-model/components/filter-component.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export * from "./filter-component"; | ||
export * from "./search-component"; | ||
export * from "./table-component"; |
20 changes: 0 additions & 20 deletions
20
src/components/common/risk-model/components/search-component.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.