File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed
dev/src/app/(payload)/admin
payload/collection/fields Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import { AccountRowLabel as AccountRowLabel_06d0cb594d8f6ba2ac35015f930c882e } from 'payload-authjs/components'
12import { SignInWithAuthjsButton as SignInWithAuthjsButton_06d0cb594d8f6ba2ac35015f930c882e } from 'payload-authjs/components'
23import { default as default_2c1e1c35da30a80d88551f9fcc61be66 } from 'src/payload/components/Greeting'
34
45export const importMap = {
6+ "payload-authjs/components#AccountRowLabel" : AccountRowLabel_06d0cb594d8f6ba2ac35015f930c882e ,
57 "payload-authjs/components#SignInWithAuthjsButton" : SignInWithAuthjsButton_06d0cb594d8f6ba2ac35015f930c882e ,
68 "/Greeting#default" : default_2c1e1c35da30a80d88551f9fcc61be66
79}
Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { useRowLabel } from "@payloadcms/ui" ;
4+ import type { Account } from "../authjs/types" ;
5+
6+ export const AccountRowLabel = ( ) => {
7+ const { data : account } = useRowLabel < Account > ( ) ;
8+
9+ return (
10+ < div
11+ style = { {
12+ display : "flex" ,
13+ alignItems : "center" ,
14+ gap : "0.5rem" ,
15+ } }
16+ >
17+ < img
18+ loading = "lazy"
19+ src = { `https://authjs.dev/img/providers/${ account . provider } .svg` }
20+ alt = "Provider"
21+ style = { {
22+ width : "1.5rem" ,
23+ height : "1.5rem" ,
24+ } }
25+ />
26+ < strong > { account . provider } </ strong > ({ account . providerAccountId } )
27+ </ div >
28+ ) ;
29+ } ;
Original file line number Diff line number Diff line change 1+ export { AccountRowLabel } from "./AccountRowLabel" ;
12export { SignInWithAuthjsButton } from "./SignInWithAuthjsButton" ;
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ export const accountsField: Field = {
2727 ] ,
2828 admin : {
2929 initCollapsed : true ,
30+ components : {
31+ RowLabel : "payload-authjs/components#AccountRowLabel" ,
32+ } ,
3033 } ,
3134 access : {
3235 create : ( ) => false ,
You can’t perform that action at this time.
0 commit comments