File size: 1,261 Bytes
49d3082
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import React from "react";
import { useAtom } from "jotai";
import { CurrentRollAtom } from "../Variables";
import { useNavigate } from "react-router-dom";

function RollCard({ roll, index }) {
    const [currentRoll, setCurrentRoll] = useAtom(CurrentRollAtom);
    const navigate = useNavigate();
    return (
        <div

            key={index}

            onClick={() => {

                setCurrentRoll(roll);

                navigate("/roll");

            }}

            className="relative hover:scale-90 cursor-pointer hover:brightness-105 transition-all rounded-xl bg-gray-100  shadow-inner text-primary-700 border border-primary-950/50 mx-0 flex items-center "

        >

            <div className="flex w-full flex-col gap-0.5 py-2 px-3">

                <div className="flex flex-wrap items-center justify-between">

                    <h5 className="text-sm font-semibold whitespace-nowrap text-primary-950">RollNo : {roll?.name}</h5>

                </div>

                <p className="text-sm text-primary-900 truncate">minWidth : {roll?.minWidth}</p>

                <p className="text-sm text-primary-900 truncate">rLength : {roll?.rLength}</p>

            </div>

        </div>
    );
}

export default RollCard;