create review and profile
This commit is contained in:
@@ -12,6 +12,8 @@ interface JoinTripButtonProps {
|
||||
isJoined: boolean;
|
||||
isFull: boolean;
|
||||
tripStatus: string;
|
||||
/** Tanggal berangkat sudah lewat (hari kalender UTC) */
|
||||
isDeparturePast?: boolean;
|
||||
}
|
||||
|
||||
export function JoinTripButton({
|
||||
@@ -21,6 +23,7 @@ export function JoinTripButton({
|
||||
isJoined,
|
||||
isFull,
|
||||
tripStatus,
|
||||
isDeparturePast,
|
||||
}: JoinTripButtonProps) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -45,6 +48,24 @@ export function JoinTripButton({
|
||||
);
|
||||
}
|
||||
|
||||
if (isJoined && isDeparturePast) {
|
||||
return (
|
||||
<div className="rounded-xl bg-neutral-100 px-3 py-3 text-center text-sm font-medium leading-relaxed text-neutral-600">
|
||||
Kamu terdaftar di trip ini. Setelah tanggal berangkat lewat,{" "}
|
||||
<span className="font-semibold text-neutral-700">pembatalan ditutup</span>
|
||||
. Jika trip sudah selesai, isi ulasan di bagian bawah halaman.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isDeparturePast && !isJoined) {
|
||||
return (
|
||||
<div className="rounded-xl bg-neutral-100 py-3 text-center text-sm font-medium text-neutral-500">
|
||||
Trip sudah lewat tanggal berangkat
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (tripStatus !== "OPEN" && !isJoined) {
|
||||
return (
|
||||
<div className="rounded-xl bg-neutral-100 py-3 text-center text-sm font-medium text-neutral-500">
|
||||
|
||||
Reference in New Issue
Block a user