Skip to content

Commit

Permalink
Remove text input for support, misc formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bLopata committed Oct 17, 2024
1 parent 5a50db1 commit 31697cb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 69 deletions.
22 changes: 11 additions & 11 deletions www/components/settings/SubscriptionSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";
'use client';

import { useState } from "react";
import { useRouter } from "next/navigation";
import { useState } from 'react';
import { useRouter } from 'next/navigation';

import { createStripePortal } from "@/utils/stripe/actions";
import { Tables } from "@/utils/database.types";
import { createStripePortal } from '@/utils/stripe/actions';
import { Tables } from '@/utils/database.types';

import PriceCard from "@/components/PriceCard";
type Subscription = Tables<"subscriptions">;
type Product = Tables<"products">;
type Price = Tables<"prices">;
import PriceCard from '@/components/PriceCard';
type Subscription = Tables<'subscriptions'>;
type Product = Tables<'products'>;
type Price = Tables<'prices'>;

interface Props {
subscription: Subscription | null;
Expand All @@ -33,7 +33,7 @@ export default function SubscriptionManager({ subscription, products }: Props) {
router.push(url);
}
} catch (error) {
console.error("Error:", error);
console.error('Error:', error);
}
setLoading(false);
};
Expand All @@ -46,7 +46,7 @@ export default function SubscriptionManager({ subscription, products }: Props) {
<div className="mt-4">
<h2 className="text-xl font-bold mb-2">Subscription Status</h2>
<p className="mb-4">
{subscription ? "Active Subscription" : "No Active Subscription"}
{subscription ? 'Active Subscription' : 'No Active Subscription'}
</p>
{subscription ? (
<button
Expand Down
81 changes: 23 additions & 58 deletions www/components/settings/SupportSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,72 +1,37 @@
"use client";
'use client';

import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Textarea } from "@/components/ui/textarea";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
} from '@/components/ui/card';

interface SupportFormProps {
user: {
id: string;
email: string;
};
}

function SupportForm({ user }: SupportFormProps) {
const [message, setMessage] = useState("");

const handleSubmit = () => {
// Implement support message submission logic
console.log("Submitting support message:", message);
};

return (
<Card className="bg-card text-card-foreground">
<CardHeader>
<CardTitle className="text-primary">Contact Support</CardTitle>
<CardDescription>
Send us a message and we&apos;ll get back to you as soon as possible.
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<Textarea
placeholder="Describe your issue or question"
value={message}
onChange={(e) => setMessage(e.target.value)}
className="bg-input text-foreground"
rows={5}
/>
</CardContent>
<CardFooter className="flex justify-start pt-6">
<Button
onClick={handleSubmit}
className="bg-primary text-primary-foreground hover:bg-primary/90"
>
Send Message
</Button>
</CardFooter>
</Card>
);
}

interface User {
id: string;
email: string;
// Add other user properties as needed
}

export function SupportSettings({ user }: { user: User }) {
export function SupportSettings() {
return (
<div className="space-y-4">
<h2 className="text-3xl font-bold text-primary">Contact Support</h2>
<SupportForm user={user} />
<Card className="bg-card text-card-foreground">
<CardHeader>
<CardTitle className="text-primary">Need Help?</CardTitle>
<CardDescription>
{`We're here to assist you with any questions or issues you may
have.`}
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<p>
For support, please email us at:{' '}
<a
href="mailto:[email protected]"
className="text-primary hover:underline"
>
[email protected]
</a>
</p>
</CardContent>
</Card>
</div>
);
}

0 comments on commit 31697cb

Please sign in to comment.