Skip to content
Snippets Groups Projects
Commit 8ad6536f authored by Liliana Sanfilippo's avatar Liliana Sanfilippo
Browse files

Tables

parent 42f029d1
No related branches found
No related tags found
No related merge requests found
Pipeline #445274 failed
import { Part } from "../data/parts";
export function PartTable(data: Array<Part>, cols: Array<string>){
let list = [];
for (let index = 0; index < data.length; index++) {
list.push(
<tr>
<td>{data[index].partname}</td>
<td><a href={data[index].url}>{data[index].registrycode}</a></td>
<td>{data[index].description}</td>
<td>{data[index].length}</td>
<td>{data[index].type}</td>
</tr>
)
}
let heads = [];
for (let index = 0; index < cols.length; index++) {
heads.push(<td>cols[index]</td>)
}
return(
<div className="flex flex-col">
<div className="overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full py-4 sm:px-6 lg:px-8">
<div className="overflow-hidden p-2">
<table className="min-w-full text-center">
<thead className="border-b bg-gray-50">
<tr>
{heads}
</tr>
</thead>
<tbody>
{list}
</tbody>
</table>
</div>
</div>
</div>
</div>
)
}
\ No newline at end of file
export interface Part{
partname: string,
registrycode: number,
description: string,
length: number,
type: PartType,
url: string
}
type PartType = "DNA" | "Protein";
/*
Vorlage:
{
partname: "",
registrycode: ,
description: "",
length: ,
type: "",
url: ""
},
*/
export const BasicParts: Array<Part> = [
{
partname: "Beispiel",
registrycode: 0,
description: "Beispiel Description",
length: 0,
type: "DNA",
url: "....."
},
]
export const CompositeParts: Array<Part> = [
{
partname: "Beispiel",
registrycode: 0,
description: "Beispiel Description",
length: 0,
type: "DNA",
url: "....."
},
]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment