Fix sort arrow positioning

This commit is contained in:
Alex Holliday committed 2025-01-07 14:45:18 -08:00
1 parent 1898880774
commit 0cc5c732c7
1 file changed
+19 -8
@@ -17,6 +17,7 @@ import { useState } from "react";
import useUtils from "../../utils"; import useUtils from "../../utils";
import { memo } from "react"; import { memo } from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import "../index.css";
const UptimeDataTable = ({ const UptimeDataTable = ({
isAdmin, isAdmin,
@@ -57,9 +58,15 @@ const UptimeDataTable = ({
{ {
id: "name", id: "name",
content: ( content: (
<Box onClick={() => handleSort("name")}> <Stack
gap={theme.spacing(4)}
alignItems="center"
direction="row"
onClick={() => handleSort("name")}
>
Host Host
<span <Stack
justifyContent="center"
style={{ style={{
visibility: sort.field === "name" ? "visible" : "hidden", visibility: sort.field === "name" ? "visible" : "hidden",
}} }}
@@ -69,8 +76,8 @@ const UptimeDataTable = ({
) : ( ) : (
<ArrowDownwardRoundedIcon /> <ArrowDownwardRoundedIcon />
)} )}
</span> </Stack>
</Box> </Stack>
), ),
render: (row) => ( render: (row) => (
<Host <Host
@@ -85,13 +92,17 @@ const UptimeDataTable = ({
{ {
id: "status", id: "status",
content: ( content: (
<Box <Stack
direction="row"
gap={theme.spacing(4)}
alignItems="center"
width="max-content" width="max-content"
onClick={() => handleSort("status")} onClick={() => handleSort("status")}
> >
{" "} {" "}
Status Status
<span <Stack
justifyContent="center"
style={{ style={{
visibility: sort.field === "status" ? "visible" : "hidden", visibility: sort.field === "status" ? "visible" : "hidden",
}} }}
@@ -101,8 +112,8 @@ const UptimeDataTable = ({
) : ( ) : (
<ArrowDownwardRoundedIcon /> <ArrowDownwardRoundedIcon />
)} )}
</span> </Stack>
</Box> </Stack>
), ),
render: (row) => { render: (row) => {
const status = determineState(row.monitor); const status = determineState(row.monitor);