import React from 'react';
import superagent from 'superagent';
import { Segment, Table, Message, Loader, Label } from 'semantic-ui-react';
/**
* Lists user grants for a given OAuth client. Empty in Phase A (no OAuth flow
* yet to produce grants); ships alongside so the detail page layout is stable.
*/
export default class OAuthGrantsList extends React.Component {
constructor(props) {
super(props);
this.state = { loading: true, grants: [], error: null };
}
async componentDidMount() {
if (!this.props.uniqueId) return;
try {
const res = await superagent
.get(`/api/admin/oauth/clients/${this.props.uniqueId}/grants`)
.accept('json');
this.setState({ grants: res.body.grants || [], loading: false });
} catch (e) {
this.setState({ error: e.response?.body?.message || e.message, loading: false });
}
}
render() {
const { loading, grants, error } = this.state;
if (loading) return User grants appear here once Phase B (authorize + consent) ships and real users start authorizing this client.