Huakun Shen 6ce27244a5
Feature: on boarding page (#46)
* feat: add deno install page

* feat: add deno install onboarding page

* feat: add ffmpeg, deno, brew install help page

* feat: improve on boarding page with deno install, setting, ffmpeg install

* refactor: update app configuration and onboarding flow

- Improved the onboarding page layout by adding a draggable region.
- Introduced a new writable store `appConfigLoaded` to track the loading status of app configuration.
- Updated the main application page to subscribe to `appConfigLoaded` for better handling of onboarding logic.
- Minor formatting changes in the ffmpeg installation help page for consistency.
2025-01-06 02:51:28 -05:00

60 lines
1.7 KiB
Svelte

<script lang="ts">
import InstallCodeBlock from "@/components/common/install-code-block.svelte"
import Icon from "@iconify/svelte"
import { IconEnum } from "@kksh/api/models"
import { Button, Tabs } from "@kksh/svelte5"
import { TauriLink } from "@kksh/ui"
import { platform } from "@tauri-apps/plugin-os"
import { onMount } from "svelte"
import { toast } from "svelte-sonner"
import { whereIsCommand } from "tauri-plugin-shellx-api"
let brewPath = $state("")
let _platform = $state(platform())
onMount(async () => {
brewPath = await whereIsCommand("brew")
})
function onInstallSuccess() {}
let alreadyInstalled = $derived(brewPath != "")
</script>
<h1 class="font-mono text-2xl font-bold">Install Homebrew</h1>
<TauriLink
href="/app/help/brew-install"
icon={IconEnum.Iconify}
iconValue="devicon:homebrew"
class="flex items-center"
>
<span class="text-lg">Homebrew Website</span>
<Icon icon="devicon:homebrew" class="h-6 w-6" />
</TauriLink>
{#if _platform !== "macos"}
<p class="font-mono text-sm text-red-500">Homebrew is only available on MacOS.</p>
{/if}
{#if alreadyInstalled}
<div class="flex items-center gap-2 font-mono text-sm">
<span></span>
<span>Homebrew is already installed at </span>
<pre class="text-sm">{brewPath}</pre>
</div>
{:else}
<div class="flex items-center gap-2 font-mono text-sm">
<span></span>
<span>Homebrew is not installed</span>
</div>
{/if}
<p class="font-mono text-sm">
Some extensions require Homebrew to enable advanced features. Homebrew is optional but
recommended.
</p>
<InstallCodeBlock
onSuccess={onInstallSuccess}
code={`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`}
lang="bash"
{alreadyInstalled}
autoInstallable={!alreadyInstalled}
/>