Tools.svelte 799 B

12345678910111213141516171819202122232425262728293031323334
  1. <script>
  2. import { getContext } from 'svelte';
  3. const i18n = getContext('i18n');
  4. import CodeEditor from './Tools/CodeEditor.svelte';
  5. let loading = false;
  6. const submitHandler = async () => {
  7. loading = true;
  8. // Call the API to submit the code
  9. };
  10. </script>
  11. <div class=" flex flex-col justify-between w-full overflow-y-auto h-full">
  12. <div class="mx-auto w-full md:px-0 h-full">
  13. <div class=" flex flex-col max-h-[100dvh] h-full">
  14. <div class="mb-2.5 flex-1 overflow-auto h-0">
  15. <CodeEditor />
  16. </div>
  17. <div class="pb-3">
  18. <button
  19. class="px-3 py-1.5 text-sm font-medium bg-emerald-600 hover:bg-emerald-700 text-gray-50 transition rounded-lg"
  20. on:click={() => {
  21. submitHandler();
  22. }}
  23. >
  24. {$i18n.t('Save')}
  25. </button>
  26. </div>
  27. </div>
  28. </div>
  29. </div>