PluginProbe
Extendify / 3.0.6
Extendify v3.0.6
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Draft / components / image-generation / CreditCounter.jsx

CreditCounter.jsx in Extendify 3.0.6, at src/Draft/components/image-generation/CreditCounter.jsx

54 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import image from '@draft/svg/Image';
2 import { Button, Icon } from '@wordpress/components';
3 import { __, sprintf } from '@wordpress/i18n';
4
5 export const CreditCounter = ({ usedCredits, total }) => {
6 if (usedCredits < total) {
7 return (
8 <div className="flex items-center justify-center gap-2">
9 <Icon className="fill-gray-700" icon={image} size="12px" />
10 <p className="mb-0 text-[12px] text-gray-700">
11 {sprintf(
12 // translators: %1$s is the number of used credits, %2$s is the total credits
13 __('%1$s of %2$s daily image credits used', 'extendify-local'),
14 usedCredits,
15 total,
16 )}
17 </p>
18 </div>
19 );
20 }
21
22 return (
23 <div className="flex gap-3 border-y-0 border-l-4 border-r-0 border-solid border-[#3858E9] bg-gray-100 p-3">
24 <div>
25 <Icon icon={image} className="fill-gray-900" size="12px" />
26 </div>
27 <div className="flex flex-col gap-2">
28 <p className="mb-0 text-[12px] font-bold text-gray-700">
29 {sprintf(
30 // translators: %1$s is the number of used credits, %2$s is the total credits
31 __('%1$s of %2$s daily image credits used', 'extendify-local'),
32 usedCredits,
33 total,
34 )}
35 </p>
36 <p className="mb-0 text-gray-900">
37 {__(
38 'You can still explore and find great images on Unsplash until your credits reset.',
39 'extendify-local',
40 )}
41 </p>
42 <Button
43 href="https://unsplash.com/"
44 variant="primary"
45 target="_blank"
46 className="justify-center text-center"
47 >
48 {__('Search on Unsplash', 'extendify-local')}
49 </Button>
50 </div>
51 </div>
52 );
53 };
54