summaryrefslogtreecommitdiff
path: root/src/components/elements/Disclosure.js
blob: 0aaedf8715be895ff14bf4f4df02adfe4e473414 (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" 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;