refactor: introduce EmDash component and improve table semantics

Created a reusable EmDash component to standardize placeholder rendering
across tables. Updated DynamicDate to use semantic <time> element instead
of Button wrapper. Improved table alignment with proper left/center/right
positioning in LinksSection and NameserversSection. Enhanced typography in
RemarksSection with medium font weight for headings.
This commit is contained in:
2025-10-23 15:14:57 -05:00
parent 704b8380f6
commit 2c67f49e2f
6 changed files with 51 additions and 33 deletions

View File

@@ -3,7 +3,7 @@ import { useMemo } from "react";
import { format } from "date-fns";
import { formatInTimeZone } from "date-fns-tz";
import TimeAgo from "react-timeago";
import { Box, Button, Tooltip, Text, Flex } from "@radix-ui/themes";
import { Box, Tooltip, Text, Flex } from "@radix-ui/themes";
import { useDateFormat } from "@/contexts/DateFormatContext";
type DynamicDateProps = {
@@ -65,9 +65,17 @@ const DynamicDate: FunctionComponent<DynamicDateProps> = ({
</Box>
}
>
<Button variant="ghost" size="1" onClick={toggleFormat} style={{ cursor: "pointer" }}>
<Text size="2">{displayValue}</Text>
</Button>
<time
dateTime={isoString}
onClick={toggleFormat}
style={{
cursor: "pointer",
textDecoration: "none",
fontSize: "var(--font-size-2)",
}}
>
{displayValue}
</time>
</Tooltip>
);
};

21
src/components/EmDash.tsx Normal file
View File

@@ -0,0 +1,21 @@
import type { FunctionComponent } from "react";
import { Text } from "@radix-ui/themes";
/**
* A reusable em dash component for displaying placeholder text in tables.
*/
const EmDash: FunctionComponent = () => {
return (
<Text
size="2"
style={{
color: "var(--gray-a8)",
userSelect: "none",
}}
>
&mdash;
</Text>
);
};
export default EmDash;