사주 풀이 고도화, NAS 배포 자동화

This commit is contained in:
2026-02-16 19:02:04 +09:00
parent d513c063cf
commit 7042373448
44 changed files with 6280 additions and 978 deletions

View File

@@ -0,0 +1,78 @@
import Link from 'next/link';
import { createClient } from '@/lib/supabase/server';
import SavedInterpretation from './SavedInterpretation';
interface PageProps {
params: Promise<{ id: string }>;
}
export default async function SavedResultPage({ params }: PageProps) {
const { id } = await params;
const supabase = await createClient();
// 인증된 사용자의 쿠키를 사용하여 RLS 통과
const { data: record, error } = await supabase
.from('saju_records')
.select('*')
.eq('id', id)
.single();
if (error || !record) {
return (
<div className="min-h-screen flex flex-col items-center justify-center p-4">
<h1 className="text-2xl font-bold text-red-600 mb-4"> .</h1>
<p className="text-gray-500 mb-4"> .</p>
<div className="flex gap-4">
<Link href="/login" className="text-indigo-600 hover:underline"></Link>
<Link href="/mypage" className="text-indigo-600 hover:underline"></Link>
<Link href="/" className="text-indigo-600 hover:underline"></Link>
</div>
</div>
);
}
const { saju_data, interpretation } = record;
const date = new Date(record.created_at).toLocaleDateString();
return (
<div className="min-h-screen bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
<div className="max-w-4xl mx-auto">
<div className="text-center mb-12">
<span className="inline-block px-3 py-1 bg-indigo-100 text-indigo-800 rounded-full text-sm font-semibold mb-4">
{date}
</span>
<h1 className="text-3xl font-bold text-gray-900"> </h1>
<p className="mt-2 text-gray-600">
{saju_data.birthDate.year} {saju_data.birthDate.month} {saju_data.birthDate.day}
</p>
</div>
<div className="bg-white rounded-3xl shadow-xl p-6 md:p-10 mb-8">
<SavedInterpretation interpretation={interpretation} />
</div>
<div className="text-center flex flex-wrap justify-center gap-4">
<Link
href="/"
className="px-6 py-3 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition font-medium"
>
</Link>
<Link
href="/mypage"
className="px-6 py-3 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300 transition font-medium"
>
</Link>
<Link
href="/saju"
className="px-6 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition font-medium"
>
</Link>
</div>
</div>
</div>
);
}