import { AlertPopupProps } from 'types' import { AlertPopup } from './AlertPopup' import { useLocalStorage } from 'hooks' type NsfwAlertPopup = Omit /** * Triggers when the user wants to switch the filter to see any of the NSFW options * (including preferences) * * Option will be remembered for the session only and will not show the popup again */ export const NsfwAlertPopup = ({ handleConfirm, handleClose }: NsfwAlertPopup) => { const [confirmNsfw, setConfirmNsfw] = useLocalStorage( 'confirm-nsfw', false ) return ( !confirmNsfw && ( { setConfirmNsfw(confirm) handleConfirm(confirm) handleClose() }} /> ) ) }