-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add patientlist backend connection
- Loading branch information
Showing
6 changed files
with
201 additions
and
97 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,44 @@ | ||
import { tw, tx } from '../twind' | ||
import type { PropsWithChildren } from 'react' | ||
import { ChevronDown, ChevronUp } from 'lucide-react' | ||
import React, { useState } from 'react' | ||
|
||
export type HideableContentSectionProps = PropsWithChildren & { | ||
initiallyOpen?: boolean, | ||
disabled: boolean, | ||
header: React.ReactNode | ||
} | ||
|
||
/** | ||
* A Component to hide and show | ||
*/ | ||
export const HideableContentSection = ({ | ||
initiallyOpen = true, | ||
disabled, | ||
children, | ||
header | ||
}: HideableContentSectionProps) => { | ||
const [open, setOpen] = useState(initiallyOpen) | ||
return ( | ||
<div className={tw('flex flex-col gap-y-2')}> | ||
<div | ||
className={tx('flex flex-row justify-between items-center', { 'cursor-pointer': !disabled })} | ||
onClick={() => { | ||
if (!disabled) { | ||
setOpen(!open) | ||
} | ||
}} | ||
> | ||
<div> | ||
{header} | ||
</div> | ||
{!disabled && (open ? <ChevronUp/> : <ChevronDown/>)} | ||
</div> | ||
{open && ( | ||
<div> | ||
{children} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} |
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
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
Oops, something went wrong.