-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif-condition.tsx
54 lines (48 loc) · 1.2 KB
/
if-condition.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import Head from "next/head";
import { col_values, printing_values } from "lib/values";
import Cell from "components/Cell";
const IfCondition = () => {
const title = "if condition execution";
return (
<>
<Head>
<title> {title} </title>
</Head>
<h1 className="text-center text-2xl mb-3"> {title} </h1>
<div className="flex gap-8">
<table>
<tbody>
{col_values.map((val, key) => {
const str_val = printing_values[key];
const condition_title = `if (${str_val}) { /* ${val ? "" : "Dees not"
} Executes */ }`;
return (
<tr key={key}>
<td className="text-right pr-3">
{str_val}
</td>
<td className="min-w-[1.75rem] min-h-[1.75rem] max-h-[1.75rem] w-7 h-7">
<Cell
result={val ? "green" : "white"}
title={condition_title}
/>
</td>
<td className="pl-3 text-sm ">
{condition_title}
</td>
</tr>
);
})}
</tbody>
</table>
{/* TODO:
<div>
- add 2nd col
1. this are white one
2. this is green one ( can be any string, number, object)
</div> */}
</div>
</>
);
};
export default IfCondition;