xonecas.io
53129
Pa

PAT / files

PAT / src / components / Welcome.tsx

1.3 KB
1"use client";
2
3import Button from "@/src/components/Button";
4import GearIcon from "@/src/components/icons/GearIcon";
5import XIcon from "@/src/components/icons/XIcon";
6import SettingsForm from "@/src/components/SettingsForm";
7import { useState } from "react";
8
9export default function Welcome() {
10  const [isSettingsOpen, setIsSettingsOpen] = useState(false);
11
12  return (
13    <div className="mx-auto w-full max-w-5xl">
14      <div className="m-8 flex flex-col gap-4 rounded-lg bg-neutral-200 p-8 dark:bg-neutral-800">
15        <h1 className="text-4xl font-bold">Hello, I&apos;m PAT 👋</h1>
16        <p>
17          <strong>PAT</strong> (Personal Assistant Thing) is your personal assistant. Start typing
18          below to start new a conversation thread or pick a previous conversation thread from the
19          sidebar.
20        </p>
21
22        <hr className="my-4 border-neutral-300 dark:border-neutral-700" />
23
24        {!isSettingsOpen && (
25          <Button onClick={() => setIsSettingsOpen(true)}>
26            <GearIcon className="h-4 w-4" />
27            Settings
28          </Button>
29        )}
30
31        {isSettingsOpen && (
32          <>
33            <Button onClick={() => setIsSettingsOpen(false)}>
34              <XIcon className="h-4 w-4" />
35              Close Settings
36            </Button>
37            <SettingsForm />
38          </>
39        )}
40      </div>
41    </div>
42  );
43}