lots of changes with docker
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "../../../components/ui/card";
|
||||
import { useAppForm } from "../../../lib/formSutff";
|
||||
import { notificationSubs } from "../../../lib/queries/notificationSubs";
|
||||
import { notifications } from "../../../lib/queries/notifications";
|
||||
|
||||
export default function NotificationsSubCard({ user }: any) {
|
||||
const { data } = useSuspenseQuery(notifications());
|
||||
const { data: ns } = useSuspenseQuery(notificationSubs(user.id));
|
||||
const form = useAppForm({
|
||||
defaultValues: {
|
||||
notificationId: "",
|
||||
emails: [user.email],
|
||||
},
|
||||
onSubmit: async ({ value }) => {
|
||||
const postD = { ...value, userId: user.id };
|
||||
console.log(postD);
|
||||
},
|
||||
});
|
||||
|
||||
let n: any = [];
|
||||
if (data) {
|
||||
n = data.map((i: any) => ({
|
||||
label: i.name,
|
||||
value: i.id,
|
||||
}));
|
||||
}
|
||||
|
||||
console.log(ns);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card className="p-3 w-128">
|
||||
<CardHeader>
|
||||
<CardTitle>Notifications</CardTitle>
|
||||
<CardDescription>
|
||||
All currently active notifications you can subscribe to. selecting a
|
||||
notification will give you a brief description on how it works
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
form.handleSubmit();
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<form.AppField name="notificationId">
|
||||
{(field) => (
|
||||
<field.SelectField
|
||||
label="Notifications"
|
||||
placeholder="Select Notification"
|
||||
options={n}
|
||||
/>
|
||||
)}
|
||||
</form.AppField>
|
||||
</div>
|
||||
|
||||
<form.AppField name="emails" mode="array">
|
||||
{(field) => (
|
||||
<field.DynamicInputField
|
||||
label="Notification Emails"
|
||||
description="Add more email addresses for notification delivery."
|
||||
inputType="email"
|
||||
addLabel="Add Email"
|
||||
//initialValue={session?.user.email}
|
||||
/>
|
||||
)}
|
||||
</form.AppField>
|
||||
<div className="flex justify-end mt-6">
|
||||
<form.AppForm>
|
||||
<form.SubmitButton>Subscribe</form.SubmitButton>
|
||||
</form.AppForm>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user