Skip to content

Commit

Permalink
feat: Show tooltips on Since components
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Aug 31, 2023
1 parent 27adae4 commit 5d192e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/webui/ui/src/components/Since.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useEffect, useState } from "react";
import { formatDurationShort } from "../utils/duration";
import Tooltip from "@mui/material/Tooltip";
import { Typography } from "@mui/material";

export const Since = (props: { startTime: Date | string }) => {
const [str, setStr] = useState("")
Expand Down Expand Up @@ -28,5 +30,9 @@ export const Since = (props: { startTime: Date | string }) => {
return () => clearTimeout(x)
}, [props.startTime, counter])

return <>{str}</>
const tooltip = props.startTime.toString()

return <Tooltip title={tooltip}>
<Typography>{str}</Typography>
</Tooltip>
}

0 comments on commit 5d192e4

Please sign in to comment.