Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
vvaldesc committed Jun 19, 2024
1 parent 566c201 commit 1fb75ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
24 changes: 7 additions & 17 deletions src/components/AntDesign/tables/Reservations_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ const Reservations_table: React.FC<Props> = ({
const unavailableEmployeesArr: Employee[] = unavailableEmployees.result ? unavailableEmployees.result.data : [];
const daytimeCategory = checkTimeOfDay(daytime);

console.log({'daytime': daytime});
console.log({'daytimeCategory': daytimeCategory});
console.log({'unavailableEmployeesArr': unavailableEmployeesArr});
console.log({'employeesArr': employeesArr});

interface DataType {
key: number;
name: string;
Expand Down Expand Up @@ -111,22 +106,17 @@ const Reservations_table: React.FC<Props> = ({
),
},
{
title: "Rating",
title: "Media",
key: "rating",
dataIndex: "rating",
// render: (_, { rating }) => (
// <Space>
// {[...Array(5)].map((_, i) => (
// <StarTwoTone
// twoToneColor={i < Math.round(rating/2) ? "gold" : "gray"}
// key={i}
// />
// ))}
// </Space>
// ),
render: (_, { rating }) => (
<Tag color={rating < 4 ? "red" : rating <= 7 ? "blue" : "green"}>
{rating} puntos
</Tag>
),
},
{
title: "Action",
title: "Reservar",
key: "action",
render: (_, record) => (
<Button
Expand Down
8 changes: 5 additions & 3 deletions src/sections/Material_booking_form/Material_booking_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ export default function Material_booking_form(props: {client_id: any, sessionInf
<div className="fecha" style={{ marginTop: "20px" }}>
<Tag color="geekblue">{selectedTime.toLocaleString()}</Tag>
<Tag color="geekblue">{weather}</Tag>
{estimatedTime_number && <Tag color={estimatedTime_number < 7 ? "green" : estimatedTime_number <= 10 ? "blue" : "red"}>
{estimatedTime_number}
</Tag>}
{estimatedTime_number && (
<Tag color={estimatedTime_number < 7 ? "green" : estimatedTime_number <= 10 ? "blue" : "red"}>
{estimatedTime_number} minutos estimados
</Tag>
)}
</div>

<Reservations_table
Expand Down

0 comments on commit 1fb75ac

Please sign in to comment.