@visns-studio/visns-components 5.9.6 → 5.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,16 +3,19 @@ import { Link, useLocation, useNavigate } from 'react-router-dom';
3
3
  import {
4
4
  Bug,
5
5
  Calendar,
6
+ CreditCardAlt1,
6
7
  Draft,
7
8
  PeopleGroup,
8
9
  Person,
9
10
  Search,
10
11
  SignOut,
11
12
  Shield,
13
+ Image,
12
14
  } from 'akar-icons';
13
15
  import CustomFetch from './Fetch';
14
16
  import Notification from './Notification';
15
17
  import SwitchAccount from './SwitchAccount';
18
+ import BusinessCardOcr from './BusinessCardOcr';
16
19
  import styles from './styles/Navigation.module.scss';
17
20
 
18
21
  const SearchComponent = ({
@@ -193,6 +196,7 @@ function Navigation({
193
196
  const [isOpen, setOpen] = useState(false);
194
197
  const [isScrolled, setIsScrolled] = useState(false);
195
198
  const [navData, setNavData] = useState(navConfig);
199
+ const [showBusinessCardOcr, setShowBusinessCardOcr] = useState(false);
196
200
 
197
201
  const appNavClasses = styles['app-nav'];
198
202
 
@@ -223,6 +227,7 @@ function Navigation({
223
227
  bug: Bug,
224
228
  calendar: Calendar,
225
229
  draft: Draft,
230
+ image: Image,
226
231
  peopleGroup: PeopleGroup,
227
232
  person: Person,
228
233
  shield: Shield,
@@ -241,6 +246,20 @@ function Navigation({
241
246
  <Notification setSystemAuth={setSystemAuth} />
242
247
  </li>
243
248
  );
249
+ } else if (n.id === 'businessCardOcr') {
250
+ return (
251
+ <li>
252
+ <button
253
+ title="Scan Business Card"
254
+ data-tooltip-id="system-tooltip"
255
+ data-tooltip-content="Scan Business Card"
256
+ onClick={() => setShowBusinessCardOcr(true)}
257
+ className={activeClass}
258
+ >
259
+ <CreditCardAlt1 size={20} />
260
+ </button>
261
+ </li>
262
+ );
244
263
  } else if (n.id === 'switchAccount') {
245
264
  return (
246
265
  <li>
@@ -599,6 +618,22 @@ function Navigation({
599
618
  </div>
600
619
  {children}
601
620
  </main>
621
+
622
+ <BusinessCardOcr
623
+ isOpen={showBusinessCardOcr}
624
+ onClose={() => setShowBusinessCardOcr(false)}
625
+ onContactSaved={(contact) => {
626
+ console.log('Contact saved:', contact);
627
+ }}
628
+ fields={
629
+ navData.settings.find((s) => s.id === 'businessCardOcr')
630
+ ?.setting.fields || []
631
+ }
632
+ fetchConfig={
633
+ navData.settings.find((s) => s.id === 'businessCardOcr')
634
+ ?.setting.fetch || []
635
+ }
636
+ />
602
637
  </div>
603
638
  ) : (
604
639
  <div className={styles.hwrap}>
@@ -635,6 +670,22 @@ function Navigation({
635
670
  )}
636
671
  </ul>
637
672
  </div>
673
+
674
+ <BusinessCardOcr
675
+ isOpen={showBusinessCardOcr}
676
+ onClose={() => setShowBusinessCardOcr(false)}
677
+ onContactSaved={(contact) => {
678
+ console.log('Contact saved:', contact);
679
+ }}
680
+ fields={
681
+ navData.settings.find((s) => s.id === 'businessCardOcr')
682
+ ?.setting.fields || []
683
+ }
684
+ fetchConfig={
685
+ navData.settings.find((s) => s.id === 'businessCardOcr')
686
+ ?.setting.fetch || null
687
+ }
688
+ />
638
689
  </div>
639
690
  );
640
691
  }