web: ui improvements for report edit mode
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { toast } from '@/components/ui/use-toast';
|
||||
import { useOrganizationParams } from '@/hooks/useOrganizationParams';
|
||||
import { pushModal } from '@/modals';
|
||||
import { useSelector } from '@/redux';
|
||||
import { api, handleError } from '@/utils/api';
|
||||
@@ -9,7 +8,6 @@ import { SaveIcon } from 'lucide-react';
|
||||
import { useReportId } from './hooks/useReportId';
|
||||
|
||||
export function ReportSaveButton() {
|
||||
const params = useOrganizationParams();
|
||||
const { reportId } = useReportId();
|
||||
const update = api.report.update.useMutation({
|
||||
onSuccess() {
|
||||
@@ -25,6 +23,7 @@ export function ReportSaveButton() {
|
||||
if (reportId) {
|
||||
return (
|
||||
<Button
|
||||
disabled={!report.dirty}
|
||||
loading={update.isLoading}
|
||||
onClick={() => {
|
||||
update.mutate({
|
||||
@@ -40,6 +39,7 @@ export function ReportSaveButton() {
|
||||
} else {
|
||||
return (
|
||||
<Button
|
||||
disabled={!report.dirty}
|
||||
onClick={() => {
|
||||
pushModal('SaveReport', {
|
||||
report,
|
||||
|
||||
Reference in New Issue
Block a user