@hed-hog/contact 0.0.194 → 0.0.198

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.
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { CopyButton } from '@/components/copy-button';
2
3
  import {
3
4
  PageHeader,
4
5
  PaginationFooter,
@@ -61,7 +62,6 @@ import { useApp, useQuery } from '@hed-hog/next-app-provider';
61
62
  import { zodResolver } from '@hookform/resolvers/zod';
62
63
  import {
63
64
  Building2,
64
- Copy,
65
65
  Edit2,
66
66
  FileText,
67
67
  Loader2,
@@ -606,19 +606,7 @@ export default function ContactPage() {
606
606
  <TableCell className="font-medium">
607
607
  <div className="flex items-center gap-2">
608
608
  {person.name || '-'}
609
- {person.name && (
610
- <Button
611
- variant="ghost"
612
- size="icon"
613
- className="h-6 w-6"
614
- onClick={() => {
615
- navigator.clipboard.writeText(person.name);
616
- toast.success(t('copiedToClipboard') || 'Copiado!');
617
- }}
618
- >
619
- <Copy className="h-3 w-3" />
620
- </Button>
621
- )}
609
+ {person.name && <CopyButton value={person.name} />}
622
610
  </div>
623
611
  </TableCell>
624
612
 
@@ -656,21 +644,9 @@ export default function ContactPage() {
656
644
  {getPrimaryContact(person, 'email')}
657
645
  {getPrimaryContact(person, 'email') &&
658
646
  getPrimaryContact(person, 'email') !== '-' && (
659
- <Button
660
- variant="ghost"
661
- size="icon"
662
- className="h-6 w-6"
663
- onClick={() => {
664
- navigator.clipboard.writeText(
665
- getPrimaryContact(person, 'email')
666
- );
667
- toast.success(
668
- t('copiedToClipboard') || 'Copiado!'
669
- );
670
- }}
671
- >
672
- <Copy className="h-3 w-3" />
673
- </Button>
647
+ <CopyButton
648
+ value={getPrimaryContact(person, 'email')}
649
+ />
674
650
  )}
675
651
  </div>
676
652
  </TableCell>
@@ -680,21 +656,9 @@ export default function ContactPage() {
680
656
  {getPrimaryContact(person, 'phone')}
681
657
  {getPrimaryContact(person, 'phone') &&
682
658
  getPrimaryContact(person, 'phone') !== '-' && (
683
- <Button
684
- variant="ghost"
685
- size="icon"
686
- className="h-6 w-6"
687
- onClick={() => {
688
- navigator.clipboard.writeText(
689
- getPrimaryContact(person, 'phone')
690
- );
691
- toast.success(
692
- t('copiedToClipboard') || 'Copiado!'
693
- );
694
- }}
695
- >
696
- <Copy className="h-3 w-3" />
697
- </Button>
659
+ <CopyButton
660
+ value={getPrimaryContact(person, 'phone')}
661
+ />
698
662
  )}
699
663
  </div>
700
664
  </TableCell>
@@ -704,21 +668,7 @@ export default function ContactPage() {
704
668
  {getPrimaryAddress(person)}
705
669
  {getPrimaryAddress(person) &&
706
670
  getPrimaryAddress(person) !== '-' && (
707
- <Button
708
- variant="ghost"
709
- size="icon"
710
- className="h-6 w-6"
711
- onClick={() => {
712
- navigator.clipboard.writeText(
713
- getPrimaryAddress(person)
714
- );
715
- toast.success(
716
- t('copiedToClipboard') || 'Copiado!'
717
- );
718
- }}
719
- >
720
- <Copy className="h-3 w-3" />
721
- </Button>
671
+ <CopyButton value={getPrimaryAddress(person)} />
722
672
  )}
723
673
  </div>
724
674
  </TableCell>
@@ -962,21 +912,7 @@ export default function ContactPage() {
962
912
  {editingPerson?.name || '-'}
963
913
  </span>
964
914
  {editingPerson?.name && (
965
- <Button
966
- variant="ghost"
967
- size="icon"
968
- className="h-6 w-6"
969
- onClick={() => {
970
- navigator.clipboard.writeText(
971
- editingPerson.name
972
- );
973
- toast.success(
974
- t('copiedToClipboard') || 'Copiado!'
975
- );
976
- }}
977
- >
978
- <Copy className="h-3 w-3" />
979
- </Button>
915
+ <CopyButton value={editingPerson.name} />
980
916
  )}
981
917
  </div>
982
918
  </div>
@@ -1027,21 +963,7 @@ export default function ContactPage() {
1027
963
  <span className="font-medium">
1028
964
  {contact.value}
1029
965
  </span>
1030
- <Button
1031
- variant="ghost"
1032
- size="icon"
1033
- className="h-6 w-6"
1034
- onClick={() => {
1035
- navigator.clipboard.writeText(
1036
- contact.value
1037
- );
1038
- toast.success(
1039
- t('copiedToClipboard') || 'Copiado!'
1040
- );
1041
- }}
1042
- >
1043
- <Copy className="h-3 w-3" />
1044
- </Button>
966
+ <CopyButton value={contact.value} />
1045
967
  </div>
1046
968
  {contact.is_primary && (
1047
969
  <Badge variant="default">Principal</Badge>
@@ -1075,22 +997,9 @@ export default function ContactPage() {
1075
997
  address.address_type_id
1076
998
  )}
1077
999
  </Badge>
1078
- <Button
1079
- variant="ghost"
1080
- size="icon"
1081
- className="h-6 w-6"
1082
- onClick={() => {
1083
- const fullAddress = `${address.line1}, ${address.city}, ${address.state}`;
1084
- navigator.clipboard.writeText(
1085
- fullAddress
1086
- );
1087
- toast.success(
1088
- t('copiedToClipboard') || 'Copiado!'
1089
- );
1090
- }}
1091
- >
1092
- <Copy className="h-3 w-3" />
1093
- </Button>
1000
+ <CopyButton
1001
+ value={`${address.line1}, ${address.city}, ${address.state}`}
1002
+ />
1094
1003
  </div>
1095
1004
  {address.is_primary && (
1096
1005
  <Badge variant="default">Principal</Badge>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/contact",
3
- "version": "0.0.194",
3
+ "version": "0.0.198",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -13,7 +13,7 @@
13
13
  "@hed-hog/api-locale": "0.0.11",
14
14
  "@hed-hog/api-mail": "0.0.7",
15
15
  "@hed-hog/api": "0.0.3",
16
- "@hed-hog/core": "0.0.194",
16
+ "@hed-hog/core": "0.0.206",
17
17
  "@hed-hog/api-prisma": "0.0.4"
18
18
  },
19
19
  "exports": {