diff --git a/components/Feature/VulnerabilitiesGrid/ResourceCard/index.js b/components/Feature/VulnerabilitiesGrid/ResourceCard/index.js index 8bef64fc..b4d864e9 100644 --- a/components/Feature/VulnerabilitiesGrid/ResourceCard/index.js +++ b/components/Feature/VulnerabilitiesGrid/ResourceCard/index.js @@ -1,9 +1,12 @@ import css from './index.module.scss'; import SummaryList from 'components/Form/SummaryList'; +import { useState } from 'react'; const HIDDEN_TAGS = ['Delivery', 'Collection', 'Food'] const ResourceCard = ({ + id, + updateSelectedResources, name, description, websites, @@ -19,6 +22,7 @@ const ResourceCard = ({ notes, distance, matches, + customerId, ...others }) => { const trimLength = (s, length) => s.length > length ? s.substring(0, length) + "..." : s @@ -27,7 +31,21 @@ const ResourceCard = ({ const websiteElement = websites && websites.length > 0 && websites.map(website => ({websites[0]})) const distributionElement = tags.filter(t => HIDDEN_TAGS.includes(t)).join(", ") const tagsElement = tags.filter(t => !HIDDEN_TAGS.includes(t)).map(item=> ({trimLength(item, 20)})) - + const snapshot = (customerId != undefined) ? true : false + const updateResource = () =>{ + updateSelectedResources({ + name:name, + description: description, + address:address, + telephone: telephone, + email:email, + referralContact: referralContact, + selfReferral: selfReferral, + openingTimes: openingTimes, + websites:websites, + notes:notes + }) + } return (