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,35 @@
|
||||
import { Link, useLocation } from "react-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FilterablePropertyDto } from "~/application/dtos/data/FilterablePropertyDto";
|
||||
import InputFilters from "~/components/ui/input/InputFilters";
|
||||
import { Button } from "~/components/ui/button";
|
||||
import { adminPath } from "~/utils/app/CanonicalUrlUtils";
|
||||
|
||||
type Props = {
|
||||
filters: FilterablePropertyDto[];
|
||||
};
|
||||
|
||||
export default function AdminAuditLogToolbar({ filters }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
const exportLabel = getFallbackTranslation(t("shared.export"), "Export");
|
||||
const exportSearchParams = new URLSearchParams(location.search);
|
||||
exportSearchParams.delete("page");
|
||||
exportSearchParams.set("export", "csv");
|
||||
const exportHref = adminPath(`audit-trails?${exportSearchParams.toString()}`, { mode: "host-aware" });
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<Button asChild variant="outline">
|
||||
<Link to={exportHref} reloadDocument>
|
||||
{exportLabel}
|
||||
</Link>
|
||||
</Button>
|
||||
<InputFilters filters={filters} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function getFallbackTranslation(value: string, fallback: string) {
|
||||
return value === "shared.export" ? fallback : value;
|
||||
}
|
||||
Reference in new issue
Block a user