consistency pass

This commit is contained in:
ppc
2024-08-07 16:49:24 +01:00
parent ea78c45727
commit a8cb1fa079
+16 -12
View File
@@ -34,28 +34,31 @@ function redirectToServerPage(router: AppRouterInstance, server: AimeServer) {
}
function ServerList(props: { servers: AimeServer[] | undefined }) {
const router = useRouter();
if (!props.servers) {
return (
<div className="flex gap-2 justify-center items-center text-gray-500 pt-5">
<Loader className="h-8 w-8"/>
<span className="text-center">Loading...</span>
</div>
)
);
}
if (!props.servers.length) {
return (<div className="flex flex-col gap-2 items-center text-gray-500 pt-5">
<Earth className="h-8 w-8"/>
<span className="text-center">No servers found. Add one below!</span>
</div>)
return (
<div className="flex flex-col gap-2 items-center text-gray-500 pt-5">
<Earth className="h-8 w-8"/>
<span className="text-center">No servers found. Add one below!</span>
</div>
);
}
const router = useRouter();
return (<>
{props.servers.map(s =>
<ContextMenu>
<ContextMenu key={s.id}>
<ContextMenuTrigger>
<Card key={s.id}>
<Card>
<div className="flex p-6 items-center gap-3">
<div className="flex-grow flex flex-col gap-4">
<h4 className="text-2xl font-semibold">{s.name}</h4>
@@ -82,13 +85,13 @@ function ServerList(props: { servers: AimeServer[] | undefined }) {
</ContextMenuItem>
<ContextMenuSeparator/>
<ContextMenuItem className="text-red-500">
<Trash className="mr-2 h-4 w-4" /> Remove Server
<Trash className="mr-2 h-4 w-4"/> Remove Server
</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>)}
<ServerAddForm/>
</>)
</>);
}
function ServerAddForm() {
@@ -137,7 +140,8 @@ function ServerAddForm() {
<Plus className="h-4 w-4"/>
</Button>
</form>
</Form>)
</Form>
);
}
export default function ServerListingPage() {
@@ -151,7 +155,7 @@ export default function ServerListingPage() {
<div className="flex flex-col gap-4 w-full flex-grow">
<ServerList servers={servers}/>
</div>
<Footer/>
</main>
);