🚚(app-impress) rename PrintToPDFButton to PDFButton
- rename PrintToPDFButton to PDFButton - rename button "Print the pad" to "Generate PDF"
This commit is contained in:
@@ -12,12 +12,12 @@ import { Template } from '@/features/templates/template';
|
|||||||
import { useCreatePdf } from '../api/useCreatePdf';
|
import { useCreatePdf } from '../api/useCreatePdf';
|
||||||
import { downloadFile } from '../utils';
|
import { downloadFile } from '../utils';
|
||||||
|
|
||||||
interface PrintToPDFButtonProps {
|
interface PDFButtonProps {
|
||||||
pad: Pad;
|
pad: Pad;
|
||||||
templateId: Template['id'];
|
templateId: Template['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const PrintToPDFButton = ({ pad, templateId }: PrintToPDFButtonProps) => {
|
const PDFButton = ({ pad, templateId }: PDFButtonProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [isFetching, setIsFetching] = useState(false);
|
const [isFetching, setIsFetching] = useState(false);
|
||||||
const { toast } = useToastProvider();
|
const { toast } = useToastProvider();
|
||||||
@@ -68,7 +68,7 @@ const PrintToPDFButton = ({ pad, templateId }: PrintToPDFButtonProps) => {
|
|||||||
createPdf({
|
createPdf({
|
||||||
templateId,
|
templateId,
|
||||||
body,
|
body,
|
||||||
body_type: 'markdown',
|
body_type: 'html',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,9 +80,9 @@ const PrintToPDFButton = ({ pad, templateId }: PrintToPDFButtonProps) => {
|
|||||||
}}
|
}}
|
||||||
disabled={isFetching}
|
disabled={isFetching}
|
||||||
>
|
>
|
||||||
{t('Print the pad')}
|
{t('Generate PDF')}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PrintToPDFButton;
|
export default PDFButton;
|
||||||
@@ -6,7 +6,7 @@ import { Box } from '@/components';
|
|||||||
import { Pad } from '@/features/pads/pad';
|
import { Pad } from '@/features/pads/pad';
|
||||||
import { TemplatesOrdering, useTemplates } from '@/features/templates';
|
import { TemplatesOrdering, useTemplates } from '@/features/templates';
|
||||||
|
|
||||||
import PrintToPDFButton from './PrintToPDFButton';
|
import PDFButton from './PDFButton';
|
||||||
|
|
||||||
interface PadToolBoxProps {
|
interface PadToolBoxProps {
|
||||||
pad: Pad;
|
pad: Pad;
|
||||||
@@ -58,7 +58,7 @@ export const PadToolBox = ({ pad }: PadToolBoxProps) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{templateIdSelected && (
|
{templateIdSelected && (
|
||||||
<PrintToPDFButton pad={pad} templateId={templateIdSelected} />
|
<PDFButton pad={pad} templateId={templateIdSelected} />
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user