1
0
Fork 0
freesewing/sites/shared/components/workbench/layout/print/settings.js

40 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-02-20 18:46:21 +01:00
import PageSizePicker from './pagesize-picker'
import OrientationPicker from './orientation-picker'
import PrintIcon from 'shared/components/icons/print'
import RightIcon from 'shared/components/icons/right'
2022-06-28 02:02:51 -05:00
import { useTranslation } from 'next-i18next'
2022-02-20 18:46:21 +01:00
const PrintLayoutSettings = props => {
2022-02-25 08:30:03 +01:00
if (!props.draft?.parts?.pages?.pages) return null
const { cols, rows, count } = props.draft.parts.pages.pages
2022-06-28 02:02:51 -05:00
const { t } = useTranslation(['workbench'])
2022-02-20 18:46:21 +01:00
return (
<div className="flex flex-row gap-8 justify-center">
2022-02-20 18:46:21 +01:00
<PageSizePicker {...props} />
<OrientationPicker {...props} />
2022-06-28 02:02:51 -05:00
<button
key="reset"
onClick={() => props.unsetGist('layout')}
className="btn btn-primary"
>
<span className="capitalize">
{t('reset')}
</span>
</button>
<div className="flex flex-row font-bold items-center px-0 text-xl">
<PrintIcon />
<span className="ml-2">{count}</span>
<span className="mx-6 opacity-50">|</span>
<RightIcon />
<span className="ml-2">{cols}</span>
<span className="mx-6 opacity-50">|</span>
<div className="rotate-90"><RightIcon /></div>
<span className="text-xl ml-2">{rows}</span>
</div>
2022-02-20 18:46:21 +01:00
</div>
)
}
export default PrintLayoutSettings