<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Barbados Legal Hub</title>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/react.min.js"></script>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/react-dom.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}
.barbados-blue { color: #003D82; }
.barbados-gold { color: #D4A574; }
.bg-barbados-blue { background-color: #003D82; }
.bg-barbados-gold { background-color: #D4A574; }
.border-barbados-gold { border-color: #D4A574; }
</style>
</head>
<body class="bg-gray-50">
<div id="root"></div>
<script>
const { useState } = React;
function BarbadosLegalHub() {
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [userEmail, setUserEmail] = useState('');
const [questions, setQuestions] = useState([
{
id: 1,
author: 'John Smith',
question: 'What is the process for filing a small claims case in Barbados?',
answer: 'Small claims can be filed in the District "A" Court. You need to complete a claim form, pay the filing fee ($50-100), and submit supporting documents. The process typically takes 3-6 months.',
timestamp: '2 hours ago',
expert: 'Legal Expert - Magistrate Court'
},
{
id: 2,
author: 'Maria Johnson',
question: 'What are my rights as a tenant in Barbados?',
answer: 'Tenants are protected under the Landlord and Tenant Act. You have the right to a written agreement, proper notice for eviction (typically 3 months), and protection from unlawful entry. Landlords must maintain habitable conditions.',
timestamp: '5 hours ago',
expert: 'Legal Expert - Property Law'
}
]);
const [newQuestion, setNewQuestion] = useState('');
const handleLogin = (e) => {
e.preventDefault();
if (userEmail) {
setIsLoggedIn(true);
}
};
const handleLogout = () => {
setIsLoggedIn(false);
setUserEmail('');
};
const handleSubmitQuestion = (e) => {
e.preventDefault();
if (newQuestion.trim()) {
const question = {
id: questions.length + 1,
author: userEmail.split('@')[0],
question: newQuestion,
answer: 'Your question has been submitted to our legal experts. We will provide an answer within 24-48 hours.',
timestamp: 'Just now',
expert: 'Awaiting Expert Response'
};
setQuestions([question, ...questions]);
setNewQuestion('');
}
};
return (
<div className="min-h-screen bg-gray-50">
{/* Header */}
<header className="bg-white border-b border-gray-200 sticky top-0 z-50">
<div className="max-w-6xl mx-auto px-4 py-4 flex items-center justify-between">
<div className="flex items-center gap-3">
<svg className="w-8 h-8 barbados-blue" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/>
</svg>
<div>
<h1 className="text-2xl font-bold barbados-blue">Barbados Legal Hub</h1>
<p className="text-xs barbados-gold">Interactive Legal Q&A Platform</p>
</div>
</div>
<div>
{isLoggedIn ? (
<div className="flex items-center gap-4">
<span className="text-sm font-medium barbados-blue">{userEmail}</span>
<button
onClick={handleLogout}
className="px-4 py-2 rounded-lg font-medium text-white bg-barbados-blue hover:opacity-90 transition"
>
Logout
</button>
</div>
) : (
<button
onClick={() => setIsLoggedIn(true)}
className="px-4 py-2 rounded-lg font-medium text-white bg-barbados-blue hover:opacity-90 transition"
>
Login
</button>
)}
</div>
</div>
</header>
{/* Login Panel */}
{!isLoggedIn && (
<div className="bg-white border-b border-gray-200">
<div className="max-w-6xl mx-auto px-4 py-8">
<form onSubmit={handleLogin} className="max-w-md">
<p className="text-sm font-medium barbados-blue mb-3">Login to Ask Questions</p>
<div className="flex gap-2">
<input
type="email"
placeholder="Enter your email"
value={userEmail}
onChange={(e) => setUserEmail(e.target.value)}
className="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
required
/>
<button
type="submit"
className="px-6 py-2 rounded-lg font-medium text-white bg-barbados-gold hover:opacity-90 transition"
>
Login
</button>
</div>
</form>
</div>
</div>
)}
{/* Main Content */}
<main className="max-w-6xl mx-auto px-4 py-8">
{isLoggedIn && (
<div className="mb-8">
<form onSubmit={handleSubmitQuestion} className="bg-white rounded-lg shadow-md p-6 border-l-4 border-barbados-gold">
<label className="block text-sm font-semibold barbados-blue mb-3">
Submit a Legal Question
</label>
<div className="flex flex-col gap-2">
<textarea
value={newQuestion}
onChange={(e) => setNewQuestion(e.target.value)}
placeholder="Ask your legal question here..."
className="flex-1 px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"
rows="3"
required
/>
<button
type="submit"
className="px-6 py-3 rounded-lg font-medium text-white bg-barbados-blue hover:opacity-90 transition self-end"
>
Submit Question
</button>
</div>
</form>
</div>
)}
{/* Q&A Display */}
<div className="space-y-6">
<h2 className="text-xl font-bold barbados-blue">Legal Questions & Answers</h2>
{questions.map((item) => (
<div key={item.id} className="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition">
{/* Question Section */}
<div className="p-6 border-b border-gray-200 bg-blue-50">
<div className="flex justify-between items-start mb-3">
<div>
<p className="text-sm font-medium barbados-gold">{item.author}</p>
<p className="text-xs text-gray-500">{item.timestamp}</p>
</div>
</div>
<h3 className="text-lg font-semibold barbados-blue">Q: {item.question}</h3>
</div>
{/* Answer Section */}
<div className="p-6">
<div className="flex items-start gap-3">
<svg className="w-5 h-5 barbados-gold mt-1 flex-shrink-0" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
</svg>
<div className="flex-1">
<p className="text-sm font-semibold barbados-blue">{item.expert}</p>
<p className="text-gray-700 mt-2 leading-relaxed">A: {item.answer}</p>
</div>
</div>
</div>
</div>
))}
</div>
</main>
{/* Footer */}
<footer className="bg-white border-t border-gray-200 mt-12">
<div className="max-w-6xl mx-auto px-4 py-6 text-center text-sm text-gray-600">
<p className="font-medium barbados-blue">Barbados Legal Hub © 2024</p>
<p className="text-xs mt-2">Disclaimer: This platform provides general legal information. For legal advice, consult a qualified attorney.</p>
<p className="text-xs mt-2">Contact: info@barbadoslegalhub.bb | Phone: +1-246-XXX-XXXX</p>
</div>
</footer>
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<BarbadosLegalHub />);
</script>
</body>
</html>
Converted to HTML with WordToHTML.net | Document Converter for Windows