|
1 |
| -import { Button } from '@/common/components/atoms/Button/Button'; |
2 |
| -import { SheetContent, SheetTrigger } from '@/common/components/atoms/Sheet'; |
3 |
| -import { Sheet } from '@/common/components/atoms/Sheet/Sheet'; |
4 |
| -import { CaseCreationForm } from '@/pages/Entities/components/CaseCreation/components/CaseCreationForm'; |
5 |
| -import { withCaseCreation } from '@/pages/Entities/components/CaseCreation/context/case-creation-context/hocs/withCaseCreation'; |
6 |
| -import { useCaseCreationContext } from '@/pages/Entities/components/CaseCreation/context/case-creation-context/hooks/useCaseCreationContext'; |
7 |
| -import { useCaseCreationWorkflowDefinition } from '@/pages/Entities/components/CaseCreation/hooks/useCaseCreationWorkflowDefinition'; |
8 | 1 | import { Plus } from 'lucide-react';
|
9 | 2 | import { valueOrNA } from '@ballerine/common';
|
| 3 | + |
10 | 4 | import { ctw } from '@/common/utils/ctw/ctw';
|
11 |
| -import { titleCase } from 'string-ts'; |
| 5 | +import { Sheet } from '@/common/components/atoms/Sheet/Sheet'; |
| 6 | +import { Button } from '@/common/components/atoms/Button/Button'; |
| 7 | +import { Tooltip } from '@/common/components/atoms/Tooltip/Tooltip'; |
| 8 | +import { SheetContent, SheetTrigger } from '@/common/components/atoms/Sheet'; |
12 | 9 | import { ScrollArea } from '@/common/components/molecules/ScrollArea/ScrollArea';
|
| 10 | +import { TooltipContent } from '@/common/components/atoms/Tooltip/Tooltip.Content'; |
| 11 | +import { TooltipTrigger } from '@/common/components/atoms/Tooltip/Tooltip.Trigger'; |
| 12 | +import { CaseCreationForm } from '@/pages/Entities/components/CaseCreation/components/CaseCreationForm'; |
| 13 | +import { withCaseCreation } from '@/pages/Entities/components/CaseCreation/context/case-creation-context/hocs/withCaseCreation'; |
| 14 | +import { useCaseCreationLogic } from '@/pages/Entities/components/CaseCreation/hooks/useCaseCreationLogic/useCaseCreationLogic'; |
13 | 15 |
|
14 | 16 | export const CaseCreation = withCaseCreation(() => {
|
15 |
| - const { workflowDefinition, isLoading, error } = useCaseCreationWorkflowDefinition(); |
16 |
| - const { isOpen, setIsOpen: setOpen } = useCaseCreationContext(); |
17 |
| - const workflowDefinitionName = |
18 |
| - workflowDefinition?.displayName || titleCase(workflowDefinition?.name ?? ''); |
| 17 | + const { isDemo, isOpen, setOpen, error, workflowDefinition, workflowDefinitionName, isLoading } = |
| 18 | + useCaseCreationLogic(); |
19 | 19 |
|
20 | 20 | return (
|
21 | 21 | <Sheet open={isOpen} onOpenChange={setOpen}>
|
22 | 22 | <SheetTrigger asChild>
|
23 |
| - <Button |
24 |
| - variant="outline" |
25 |
| - className="flex w-full items-center justify-start gap-2 font-semibold" |
26 |
| - onClick={() => setOpen(true)} |
27 |
| - > |
28 |
| - <Plus /> |
29 |
| - <span>Add case manually</span> |
30 |
| - </Button> |
| 23 | + <Tooltip delayDuration={100}> |
| 24 | + <TooltipTrigger asChild> |
| 25 | + <Button |
| 26 | + variant="outline" |
| 27 | + disabled={isDemo} |
| 28 | + className="flex w-full items-center justify-start gap-2 font-semibold disabled:!pointer-events-auto" |
| 29 | + onClick={() => setOpen(true)} |
| 30 | + > |
| 31 | + <Plus /> |
| 32 | + <span>Add case manually</span> |
| 33 | + </Button> |
| 34 | + </TooltipTrigger> |
| 35 | + <TooltipContent align="center" side="top" hidden={!isDemo}> |
| 36 | + This feature is not available for trial accounts. |
| 37 | + <br /> |
| 38 | + Talk to us to get full access. |
| 39 | + </TooltipContent> |
| 40 | + </Tooltip> |
31 | 41 | </SheetTrigger>
|
32 | 42 | <SheetContent
|
33 | 43 | side="right"
|
|
0 commit comments