2022-01-05 18:23:44 +00:00
|
|
|
import clsx from 'clsx'
|
|
|
|
import { useState } from 'react'
|
|
|
|
|
|
|
|
export function AdvancedPanel(props: { children: any }) {
|
|
|
|
const { children } = props
|
|
|
|
const [collapsed, setCollapsed] = useState(true)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
tabIndex={0}
|
|
|
|
className={clsx(
|
2022-02-11 18:40:22 +00:00
|
|
|
'collapse collapse-arrow relative',
|
2022-01-05 18:23:44 +00:00
|
|
|
collapsed ? 'collapse-close' : 'collapse-open'
|
|
|
|
)}
|
|
|
|
>
|
2022-01-06 09:48:27 +00:00
|
|
|
<div
|
|
|
|
onClick={() => setCollapsed((collapsed) => !collapsed)}
|
|
|
|
className="cursor-pointer"
|
|
|
|
>
|
2022-02-11 18:40:22 +00:00
|
|
|
<div className="mt-4 mr-6 text-right text-sm text-gray-500">
|
2022-01-05 18:23:44 +00:00
|
|
|
Advanced
|
|
|
|
</div>
|
|
|
|
<div
|
2022-02-11 18:40:22 +00:00
|
|
|
className="collapse-title absolute h-0 min-h-0 w-0 p-0"
|
2022-01-05 18:23:44 +00:00
|
|
|
style={{
|
|
|
|
top: -2,
|
|
|
|
right: -15,
|
2022-01-09 05:10:08 +00:00
|
|
|
color: '#6a7280' /* gray-500 */,
|
2022-01-05 18:23:44 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2022-02-11 18:40:22 +00:00
|
|
|
<div className="collapse-content m-0 !bg-transparent !p-0">
|
2022-01-05 18:23:44 +00:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|