This commit is contained in:
gpt-engineer-app[bot]
2025-12-21 15:38:22 +00:00
parent f4a1dee9bd
commit ed0d97bb4b
6 changed files with 27 additions and 27 deletions

View File

@@ -31,7 +31,7 @@ interface ConsultingSlot {
meet_link: string | null;
created_at: string;
profiles?: {
full_name: string;
name: string;
email: string;
};
}
@@ -78,7 +78,7 @@ export default function AdminConsulting() {
.from('consulting_slots')
.select(`
*,
profiles:user_id (full_name, email)
profiles:user_id (name, email)
`)
.order('date', { ascending: false })
.order('start_time', { ascending: true });
@@ -125,7 +125,7 @@ export default function AdminConsulting() {
body: {
template_key: 'consulting_scheduled',
recipient_email: selectedSlot.profiles.email,
recipient_name: selectedSlot.profiles.full_name,
recipient_name: selectedSlot.profiles.name,
variables: {
consultation_date: format(parseISO(selectedSlot.date), 'd MMMM yyyy', { locale: id }),
consultation_time: `${selectedSlot.start_time.substring(0, 5)} - ${selectedSlot.end_time.substring(0, 5)}`,
@@ -168,7 +168,7 @@ export default function AdminConsulting() {
start_time: selectedSlot.start_time,
end_time: selectedSlot.end_time,
topic: selectedSlot.topic_category,
client_name: selectedSlot.profiles?.full_name || 'Client',
client_name: selectedSlot.profiles?.name || 'Client',
client_email: selectedSlot.profiles?.email,
calendar_id: settings.integration_google_calendar_id,
}),
@@ -251,7 +251,7 @@ export default function AdminConsulting() {
{todaySlots.map(slot => (
<div key={slot.id} className="flex items-center justify-between text-sm">
<span>
{slot.start_time.substring(0, 5)} - {slot.profiles?.full_name || 'N/A'} ({slot.topic_category})
{slot.start_time.substring(0, 5)} - {slot.profiles?.name || 'N/A'} ({slot.topic_category})
</span>
{slot.meet_link ? (
<a href={slot.meet_link} target="_blank" rel="noopener noreferrer" className="text-primary underline flex items-center gap-1">
@@ -334,7 +334,7 @@ export default function AdminConsulting() {
</TableCell>
<TableCell>
<div>
<p className="font-medium">{slot.profiles?.full_name || '-'}</p>
<p className="font-medium">{slot.profiles?.name || '-'}</p>
<p className="text-sm text-muted-foreground">{slot.profiles?.email}</p>
</div>
</TableCell>
@@ -425,7 +425,7 @@ export default function AdminConsulting() {
<TableRow key={slot.id}>
<TableCell>{format(parseISO(slot.date), 'd MMM yyyy', { locale: id })}</TableCell>
<TableCell>{slot.start_time.substring(0, 5)} - {slot.end_time.substring(0, 5)}</TableCell>
<TableCell>{slot.profiles?.full_name || '-'}</TableCell>
<TableCell>{slot.profiles?.name || '-'}</TableCell>
<TableCell><Badge variant="outline">{slot.topic_category}</Badge></TableCell>
<TableCell>
<Badge variant={statusLabels[slot.status]?.variant || 'secondary'}>
@@ -462,7 +462,7 @@ export default function AdminConsulting() {
<div className="p-3 bg-muted rounded-lg text-sm space-y-1">
<p><strong>Tanggal:</strong> {format(parseISO(selectedSlot.date), 'd MMMM yyyy', { locale: id })}</p>
<p><strong>Waktu:</strong> {selectedSlot.start_time.substring(0, 5)} - {selectedSlot.end_time.substring(0, 5)}</p>
<p><strong>Klien:</strong> {selectedSlot.profiles?.full_name}</p>
<p><strong>Klien:</strong> {selectedSlot.profiles?.name}</p>
<p><strong>Topik:</strong> {selectedSlot.topic_category}</p>
{selectedSlot.notes && <p><strong>Catatan:</strong> {selectedSlot.notes}</p>}
</div>