import { useDispatch, useSelector } from 'react-redux';
import fetchWillsList, { willsListSelector } from '@redux/slices/wills-list';
const { results } = useSelector(willsListSelector);
const dispatch = useDispatch();
React.useEffect(() => {
dispatch<any>(fetchWillsList());
}, []);
const handleCardClick = (cardName: string) => {
let willTypeName: string = '';
let willTypeGUID: string = '';
setActiveCard(cardName);
results.forEach((will: any) => {
if (cardName === 'draftWill' && will.willTypeName === 'Templated Full Will') {
willTypeName = will.willTypeName;
willTypeGUID = will.willTypeGUID;
} else if (cardName === 'willCopyUpload' && will.willTypeName === 'Full Will') {
willTypeName = will.willTypeName;
willTypeGUID = will.willTypeGUID;
}
});
setSelectedWillCard({ willTypeName, willTypeGUID });
};
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter