Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.tsx 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { PageHeader } from '@/components/page-header';
  2. import { Button } from '@/components/ui/button';
  3. import { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar';
  4. import { useSetModalState } from '@/hooks/common-hooks';
  5. import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
  6. import { Trash2 } from 'lucide-react';
  7. import { AgentSidebar } from './agent-sidebar';
  8. import FlowCanvas from './canvas';
  9. import { useFetchDataOnMount } from './hooks/use-fetch-data';
  10. export default function Agent() {
  11. const { navigateToAgentList } = useNavigatePage();
  12. const {
  13. visible: chatDrawerVisible,
  14. hideModal: hideChatDrawer,
  15. showModal: showChatDrawer,
  16. } = useSetModalState();
  17. useFetchDataOnMount();
  18. return (
  19. <section>
  20. <PageHeader back={navigateToAgentList} title="Agent 01">
  21. <div className="flex items-center gap-2">
  22. <Button variant={'icon'} size={'icon'}>
  23. <Trash2 />
  24. </Button>
  25. <Button variant={'outline'} size={'sm'}>
  26. Save
  27. </Button>
  28. <Button variant={'outline'} size={'sm'}>
  29. API
  30. </Button>
  31. <Button variant={'outline'} size={'sm'}>
  32. Run app
  33. </Button>
  34. <Button variant={'tertiary'} size={'sm'}>
  35. Publish
  36. </Button>
  37. </div>
  38. </PageHeader>
  39. <div>
  40. <SidebarProvider>
  41. <AgentSidebar />
  42. <div className="w-full">
  43. <SidebarTrigger />
  44. <div className="w-full h-full">
  45. <FlowCanvas
  46. drawerVisible={chatDrawerVisible}
  47. hideDrawer={hideChatDrawer}
  48. ></FlowCanvas>
  49. </div>
  50. </div>
  51. </SidebarProvider>
  52. </div>
  53. </section>
  54. );
  55. }