1 import { type DecryptedLink, usePublicSessionUser } from '../../../../store';
3 export const usePublicLinkOwnerInfo = (linksInput: DecryptedLink | DecryptedLink[]) => {
4 const { userAddressEmail } = usePublicSessionUser();
6 const links = Array.isArray(linksInput) ? linksInput : [linksInput];
8 if (!userAddressEmail || !links.length) {
15 const isLastEditor = links.every((link) => {
16 const signatureAddress = link.isFile ? link.activeRevision?.signatureAddress : link.signatureAddress;
17 return signatureAddress === userAddressEmail;
20 const isCreator = links.every((link) => {
21 return link.signatureAddress === userAddressEmail;