summaryrefslogtreecommitdiff
path: root/src/components/elements/Disclosure.js
blob: 584fa144639883b052387ffec713f66bd536bf28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const { ChevronUpIcon, ChevronDownIcon } = require("@heroicons/react/24/outline");

const Disclosure = ({ label, active, onClick }) => (
  <div className={`flex justify-between p-4 ` + (active && 'bg-yellow_r-2')} onClick={onClick}>
    <p className="font-medium leading-normal">{ label }</p>
    { onClick && ( active ? (
      <ChevronUpIcon className="w-5 h-5" />
    ) : (
      <ChevronDownIcon className="w-5 h-5" />
    ) ) }
  </div>
);

export default Disclosure;