Public
Back
Version 15
4/16/2024
/** @jsx jsx */
/** @jsxFrag Fragment */
import { jsx, Fragment } from 'https://deno.land/x/hono/middleware.ts';
import type { FC } from 'hono/jsx';
import RootLayout from "https://esm.town/v/iamseeley/RootLayout";
interface EditProfilePageProps {
user: {
id: number;
username: string;
email: string;
name: string;
bio: string;
// Add other user properties as needed
};
}
const EditProfilePage: FC<EditProfilePageProps> = ({ user }) => {
return (
<RootLayout>
<form action={`/edit-profile/${user.username}`} method="POST">
<div className="mb-4">
<input type="text" id="name" name="name" value={user.name || 'Name'} className="text-2xl font-bold mb-4" required />
</div>
<div className="mb-4">
<textarea id="bio" name="bio" className="w-full" required>{user.bio || ''}</textarea>
</div>
<button type="submit" className="px-4 py-2 font-bold text-white bg-blue-500 rounded-md hover:bg-blue-600">Save Changes</button>
</form>
<a href={`/${user.username}`} className="text-blue-500 hover:underline">View Profile</a>
</RootLayout>
);
};
export default EditProfilePage;
Updated: May 23, 2024