forked from ohcnetwork/care_fe
-
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.
Medicine: Adds
type
filter for medibase search (ohcnetwork#6186)
* add type filter for medibase * Consultation: Verified By Doctor as Dropdown * add missing model changes * Revert "add missing model changes" This reverts commit 149592e. * Revert "Consultation: Verified By Doctor as Dropdown" This reverts commit 4113172.
- Loading branch information
1 parent
f535fd3
commit b0c61dc
Showing
3 changed files
with
73 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { classNames } from "../../Utils/utils"; | ||
|
||
interface Props<T extends string> { | ||
tabs: Record<T, string>; | ||
selected: T; | ||
onChange: (tab: T) => void; | ||
size?: "sm" | "md" | "lg"; | ||
} | ||
|
||
export default function Switch<T extends string>({ | ||
size = "sm", | ||
...props | ||
}: Props<T>) { | ||
return ( | ||
<ul role="list" className="flex"> | ||
{Object.keys(props.tabs).map((tab) => { | ||
return ( | ||
<li | ||
key={tab} | ||
tabIndex={0} | ||
className={classNames( | ||
"cursor-pointer select-none border shadow-sm outline-none transition-all duration-200 ease-in-out first:rounded-l last:rounded-r focus:ring-1", | ||
size === "sm" && "px-2 py-1 text-xs", | ||
size === "md" && "px-3 py-2 text-sm", | ||
size === undefined && "px-3 py-2 text-sm", | ||
size === "lg" && "px-4 py-3 text-base", | ||
props.selected === tab | ||
? "border-primary-500 bg-primary-500 font-semibold text-white hover:bg-primary-600 focus:border-primary-500 focus:ring-primary-500" | ||
: "border-gray-400 bg-gray-50 hover:bg-gray-200 focus:border-primary-500 focus:ring-primary-500" | ||
)} | ||
onClick={() => props.onChange(tab as T)} | ||
> | ||
{props.tabs[tab as T]} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
); | ||
} |
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
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