Public Access
feat(ui): add people lists for game owners and community stats
This commit is contained in:
1 parent
b213b067dc
commit
3aed243e35
22 files changed
+425
-12
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import {useState} from 'react';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
|
||||
import {Card} from '@/components/ui/card';
|
||||
import PeopleList from './PeopleList.jsx';
|
||||
import {fetchOwners} from '../../utils/people.js';
|
||||
|
||||
/** Who else owns this game: names of users who opted in, the rest as a count. */
|
||||
export default function OwnersCard({appid}) {
|
||||
const {t} = useTranslation();
|
||||
const [count, setCount] = useState(null);
|
||||
|
||||
const load = async (page) => {
|
||||
const result = await fetchOwners({appid, page});
|
||||
if (result.ok && page === 0) setCount(result.data.listedTotal + result.data.privateCount);
|
||||
return result;
|
||||
};
|
||||
|
||||
return (
|
||||
<Card className="gap-3 p-4">
|
||||
{count > 0 && <p className="font-medium">{t('PEOPLE.OTHER_OWNERS', {count})}</p>}
|
||||
<PeopleList load={load} showYou={false}/>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user