@@ -3,7 +3,7 @@ import { useArray, useCanWrite, useResource, useStore } from '@tomic/react';
3
3
import { ContainerNarrow } from '../components/Containers' ;
4
4
import { useCurrentSubject } from '../helpers/useCurrentSubject' ;
5
5
import { Right , urls } from '@tomic/lib' ;
6
- import ResourceInline from '../views/ResourceInline' ;
6
+ import ResourceInline , { ErrorLook } from '../views/ResourceInline' ;
7
7
import { Card , CardInsideFull , CardRow } from '../components/Card' ;
8
8
import { FaGlobe } from 'react-icons/fa' ;
9
9
import styled from 'styled-components' ;
@@ -12,17 +12,19 @@ import { InviteForm } from '../components/InviteForm';
12
12
import toast from 'react-hot-toast' ;
13
13
import { PageTitle } from '../components/PageTitle' ;
14
14
15
- const useValueOpts = {
16
- commit : false ,
17
- } ;
18
-
19
15
/** Form for managing and viewing rights for this resource */
20
16
export function ShareRoute ( ) : JSX . Element {
21
17
const [ subject ] = useCurrentSubject ( ) ;
22
18
const resource = useResource ( subject ) ;
23
19
const store = useStore ( ) ;
24
20
const [ canWrite ] = useCanWrite ( resource ) ;
25
21
const [ showInviteForm , setShowInviteForm ] = useState ( false ) ;
22
+ const [ err , setErr ] = useState ( null ) ;
23
+
24
+ const useValueOpts = {
25
+ commit : false ,
26
+ handleValidationError : setErr ,
27
+ } ;
26
28
27
29
const [ writers , setWriters ] = useArray (
28
30
resource ,
@@ -145,6 +147,7 @@ export function ShareRoute(): JSX.Element {
145
147
Save
146
148
</ Button >
147
149
) }
150
+ { err && < ErrorLook > { err } </ ErrorLook > }
148
151
{ inheritedRights . length > 0 && (
149
152
< Card >
150
153
< RightsHeader text = 'inherited rights:' />
0 commit comments