1e0845f4b9
* Add tsconfig.json for common * Prefer `const` over `let` over `var` * Kill dead code * Fix some trivial Typescript issues * Turn on Typescript linting in common except for no-explicit-any * Correctly specify tsconfig dir name in functions eslintrc * Give react children explicit types * Add explicit types to removeUndefinedProps * Create StripeSession type * Give event in Dropdown an explicit type * Revert "Give event in Dropdown an explicit type" This reverts commit80604310f2
. * Give bids in NewBidTable an explicit type * Cast results of removeUndefinedProps when neccessary * Fix type of JoinSpans * Revert "Cast results of removeUndefinedProps when neccessary" This reverts commit5541617bc8
. * Revert "Add explicit types to removeUndefinedProps" This reverts commitccf8ffb0b5
. * Give React children types everywhere * Give event a type * Give event correct type * Lint * Standardize React import Co-authored-by: Marshall Polaris <marshall@pol.rs>
39 lines
952 B
TypeScript
39 lines
952 B
TypeScript
import clsx from 'clsx'
|
|
import { useState, ReactNode } from 'react'
|
|
|
|
export function AdvancedPanel(props: { children: ReactNode }) {
|
|
const { children } = props
|
|
const [collapsed, setCollapsed] = useState(true)
|
|
|
|
return (
|
|
<div
|
|
tabIndex={0}
|
|
className={clsx(
|
|
'collapse collapse-arrow relative',
|
|
collapsed ? 'collapse-close' : 'collapse-open'
|
|
)}
|
|
>
|
|
<div
|
|
onClick={() => setCollapsed((collapsed) => !collapsed)}
|
|
className="cursor-pointer"
|
|
>
|
|
<div className="mt-4 mr-6 text-right text-sm text-gray-500">
|
|
Advanced
|
|
</div>
|
|
<div
|
|
className="collapse-title absolute h-0 min-h-0 w-0 p-0"
|
|
style={{
|
|
top: -2,
|
|
right: -15,
|
|
color: '#6a7280' /* gray-500 */,
|
|
}}
|
|
/>
|
|
</div>
|
|
|
|
<div className="collapse-content m-0 !bg-transparent !p-0">
|
|
{children}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|