src/app/legacy/containers/ConsentBanner/useConsentBanners/README.md
# useConsentBanners
```js
import useConsentBanners from '.';
const {
showPrivacyBanner,
showCookieBanner,
handlePrivacyBannerAccepted,
handleCookieBannerAccepted,
handleCookieBannerRejected,
} = useConsentBanners();
```
The `useConsentBanners` custom hook reads the user's cookies `ckns_privacy`, `ckns_explicit` and `ckns_policy` on component mount and returns up-to-date state variables `showPrivacyBanner` and `showCookieBanner` you can use to show/hide the correct banner.
It also provides event handlers `handlePrivacyBannerAccepted`, `handleCookieBannerAccepted` and `handleCookieBannerRejected` that when you bind to the relevant user events will take care of setting the correct cookies, making the correct requests to the cookie oven and updating the `showPrivacyBanner` and `showCookieBanner` state.