mirror of
https://github.com/WDI-Ideas/rubix-admin-panel.git
synced 2026-04-28 02:45:50 +00:00
10 lines
301 B
React
10 lines
301 B
React
|
|
const extractFilename = (filePath) => {
|
||
|
|
console.log(filePath);
|
||
|
|
// Use the split method to break the path into parts based on '/'
|
||
|
|
const parts = filePath.split('/');
|
||
|
|
// Return the last part, which is the filename
|
||
|
|
return parts[parts.length - 1];
|
||
|
|
};
|
||
|
|
|
||
|
|
export default extractFilename ;
|