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