Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import { Link } from "react-router";
|
||||
import { useLocaleFormatters } from "~/locale/format";
|
||||
|
||||
export default function RowFolioCell({ prefix, folio, href, onClick }: { prefix: string; folio: number; href?: string; onClick?: () => void }) {
|
||||
const formatters = useLocaleFormatters();
|
||||
const folioText = formatters.number(folio ?? 0, {
|
||||
maximumFractionDigits: 0,
|
||||
minimumIntegerDigits: 4,
|
||||
useGrouping: false,
|
||||
});
|
||||
const text = `${prefix}-${folioText}`;
|
||||
|
||||
return (
|
||||
<>
|
||||
{href ? (
|
||||
<Link
|
||||
to={href}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
className="hover border-border text-muted-foreground hover:text-foreground bg-secondary rounded-md border border-b px-1 py-0.5 text-center text-sm hover:underline"
|
||||
>
|
||||
{text}
|
||||
</Link>
|
||||
) : onClick ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onClick();
|
||||
}}
|
||||
className="hover border-border text-muted-foreground hover:text-foreground bg-secondary rounded-md border border-b px-1 py-0.5 text-center text-sm hover:underline"
|
||||
>
|
||||
{text}
|
||||
</button>
|
||||
) : (
|
||||
<div>{text}</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user