2026-03-31 11:59:00 +08:00
|
|
|
"use client"
|
|
|
|
|
import { useSetAtom } from "jotai"
|
2026-06-09 16:37:40 +08:00
|
|
|
import { useEffect } from "react"
|
2026-03-31 11:59:00 +08:00
|
|
|
import { scopesAtom } from "@/lib/stores/scopes"
|
|
|
|
|
import type { Admin } from "@/models/admin"
|
|
|
|
|
|
|
|
|
|
export default function SetScopes(props: {
|
|
|
|
|
admin: Admin & { scopes: string[] }
|
|
|
|
|
}) {
|
|
|
|
|
const setScopes = useSetAtom(scopesAtom)
|
|
|
|
|
|
2026-06-09 16:37:40 +08:00
|
|
|
useEffect(() => {
|
|
|
|
|
setScopes(props.admin.scopes)
|
|
|
|
|
}, [props.admin.scopes, setScopes])
|
|
|
|
|
|
2026-03-31 11:59:00 +08:00
|
|
|
return null
|
|
|
|
|
}
|